Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Enhancement request: Tagged Script/Link in header that will execute on loadPage #2693

Closed
ahutch opened this issue Oct 13, 2011 · 1 comment
Closed

Comments

@ahutch
Copy link

ahutch commented Oct 13, 2011

From JQM:

The reason that the head is ignored for Ajax page content: it's just too complex. The framework would need to compare and >reconcile the contents of multiple page head elements as they are loaded into the DOM so we leave this task to the developer.

In the case that script is injected in the head on a page by page basis it is possible for me to tag that script. I already see that script within the roll=page is already executed. A small addition of code for the loadPage function could allow head scripts too.

<script class="page_script" src="/javascripts/page.js" type="text/javascript"></script>
var headx = html.split( /<\/?head[^>]*>/gmi )[1]; 
var newdiv = document.createElement('div'); 
newdiv.innerHTML = headx; 
$('head').append(newdiv.getElementsByClassName('page_script'));
@toddparker
Copy link
Contributor

Would you mind linking this up from the feature request wiki page here on github so we can re-open later if we decide to tackle this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants