question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

the index page do not trigger pageinit method

See original GitHub issue

i write a page show messages,in the pageinit method i want ajax call the data service and add message to the page,but it not work,it seem only when the page change the pageinit method will call.

<div class="view view-main">
              <div class="navbar">
          <div class="navbar-inner">
            <div class="center sliding">Message Board</div>
            <div class="right"></div>
          </div>
        </div>
            <div class="pages navbar-through">
                <div data-page="messages" class="page no-toolbar toolbar-fixed">
                    <div class="page-content messages-content">
                        <div class="messages">
                            <div class="messages-date">
                                Sunday, Feb 9, <span>12:58</span></div>
                            <div class="message message-sent">
                                Message</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

4reactions
pedropamncommented, Jan 29, 2017

I solve this issue this way:

myApp.onPageInit('home', function (page) {
	//functions
}).trigger();
3reactions
shastoxcommented, Dec 4, 2015

Здравствуйте.

Та же проблема, пробовал использовать все ваши примеры (хочу сделать AJAX-запрос), получаю:

TypeError: $$ is undefined
$$.ajax({

Код такой:

document.addEventListener('pageInit', function (e) {
    page = e.detail.page;
    if (page.name === 'index') {
        $$.ajax({
            ...
        })
    }
});

// Initialize app
var myApp = new Framework7();

Задача: отправить AJAX-запрос при открытии index-страницы, т.е. самой первой.

Read more comments on GitHub >

github_iconTop Results From Across the Web

jquery pageinit not firing - javascript - Stack Overflow
I have 2 pages that I linked using swipeleft and swiperight event(back and forth) but when I swipe to the other page, jquery...
Read more >
pageInit not triggered in v5.1.0 - Questions - Framework7 Forum
Hi, I have shared my app init and then page init code with version 4 it was working like charm but i don't...
Read more >
pageinit event not fired with 1.3.1 - jQuery Forum
I replace the live method by on to create pageinit event, but the event is never fired. I modifed the index.html provided with...
Read more >
NetSuite Applications Suite - SuiteScript 2.x Client Script Type
validateLine Function · pageInit Function and Checking Context ... If you have a deployed client script with a pageInit entry point, that script...
Read more >
Pages - jQuery Mobile Demos
A HTML document may start with a single "page" and the AJAX navigation system will ... (Older devices with browsers that don't understand...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found