Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.
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

Description

@ahutch

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'));

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions