In jQuery Mobile, I can define "mobile pages" as a div using data-role=page .
They can be stored in other HTML files and inserted ad-hoc into the main HTML page.
In such a div I can put the script tag and that the script will also be entered on my main page.
the script is not displayed as a script tag in my DOM, but rather it seems to be entered into a string, and therefore it is not displayed in the standard way in the debugger, for example. FireBug script.
Has anyone found a normal way to debug these scripts (hopefully in FF or Chrome)?
EDIT:
Just to clarify. The script tag on the โotherโ page is not an inline script. It:
<div data-role="page" id="some_id"> <script type="text/javascript" src="MyScript.js"></script> ... </div>
However, it is introduced as a built-in script in the DOM.
BTW - if I put a script tag in the HTML HEAD, it does not load at all.
EDIT 2:
Additional explanations:
I am writing a framework in which "extension modules" will be inserted on the clientโs site and deciding which module (that is, additional "pages" with scripts) to load is a run-time solution. Therefore, I do not have any prior knowledge on my main page, which are loaded with scripts and should delay loading until the module loads.
My ultimate goal here is to give module developers the ability to debug their scripts. For this, I would like to get a solution in which script link files are available in FireBug / ChromeDevTools, like any other script.
It seems that the standard jquery (core, not mobile) behavior is to remove the script tag from the loaded AJAX html and eval its built-in, instead of leaving the script tag there and let the browser load it normally.
I really donโt quite understand the motives for this, and it really interferes with my debugging options: - (
By the way, I'm using jQuery 1.5.2 (same behavior with 1.5.1) and jQuery Mobile alpha 4 (same with 3)
source share