Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

$.mobile.changepage not loading external .JS file #5266

Closed
samikrc opened this Issue Nov 9, 2012 · 1 comment

Comments

Projects
None yet
2 participants

samikrc commented Nov 9, 2012

Issue description

JQM does not seem to be loading external JS from a script tag when the following conditions are satisfied:
a. The tag is within a page div in another html file which is loaded using $.mobile.changePage()
b. The JS file is specified using a relative URL, and the file is loaded from a sibling folder in the directory hierarchy.

Test page

Can't create a jsbin type test page since the test involves multiple files. I have created a zip file containing the folder structure and the test cases, that can be downloaded from the following URL:
[https://docs.google.com/open?id=0B1EuN_O-nek1bi1LNGFoNXNmcjQ]
Click on the URL, and then File -> Download.

Steps to reproduce

a. Extract the zip file
b. Double-click on the 'conflist.html' file in 'html' folder.
c. Click on the button. Get a spinner.
d. My FireBug console displays the following messages:

              Inside test_newpage.html                 jquery....min.js (line 3)
              ReferenceError: Dummy is not defined
                      objDummy.toString("test param");

Expected outcome

The console should display:

                    Loaded dummy.js                          jquery....min.js (line 7)
                    Inside test_newpage.html           jquery....min.js (line 3)
                    String representation of 'Dummy', got param: test param      jquery....min.js (line 4)

Actual outcome

The console displays the following:

              Inside test_newpage.html                 jquery....min.js (line 3)
              ReferenceError: Dummy is not defined
                      objDummy.toString("test param");

Platforms/browsers (including version) and devices tested

Tested in FireFox 16.0.2 and IE9.

jQuery Mobile and jQuery core version used

JQM 1.2.0, JQ 1.7.2.

Other relevant information, e.g. using PhoneGap

If I move dummy.js to the same folder as the html files, and modify the path accordingly in newpage.html, things work fine and I get all the outputs. This also works if I put dummy.js in a subfolder inside the html folder.

Owner

arschmitz commented Aug 7, 2013

nav has been refactored and this is stale for over 9 months and no valid test page provided if a jsbin test page is provided will reopen

@arschmitz arschmitz closed this Aug 7, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment