www.webdeveloper.com
Results 1 to 1 of 1

Thread: Selection of inline scripts disappearing from one line to the other

  1. #1
    Join Date
    Jan 2011
    Location
    Munich, Germany
    Posts
    223

    Selection of inline scripts disappearing from one line to the other

    Hello all,

    I've been fighting around with this issue for a few days now, that's why I'm raising this thread.
    I've also researched the web in vain...
    Maybe someone has run into something like this before...

    Algorithm outline: (in the context of handling inline scripts - pseudo code)

    Preconditions:

    - Fetch the HEAD and BODY of the target page into jQuery variables (head and body)
    - Filter out <links> and <scripts> in the HEAD (works)
    - Filter out <scripts> in the BODY with

    Code:
    bjss = body.find("scripts");
    $s.t = bjss.filter(function() { return !$(this).attr('src'); });
    When debugging, I can see that

    $s.t correctly holds some inline scripts.

    Then call another function, that does not manipulate $s.t.

    In the final function call, that is supposed to handle the inline scripts,

    Code:
    $s.t
    ...for some reason is empty:

    Code:
    ($s.t.length==0)
    How can a jQuery selection just disappear more or less from "one line to the next"?

    EDIT:

    http://stackoverflow.com/questions/4...e-disappearing

    It could be related to the above thread, as I'm passing back inner variables of "sub-plugins" up to its clients.

    But if that's the case, I'd have to refactor the code heavily, as the same symptoms could arise anywhere it future randomly.

    The way I understood garbage collection in JavaScript, as long as there is a reference to data remaining, it is not collected?

    What's best practice for sharing data across function calls?


    Thanks in advance and
    Kind regards
    Last edited by arvgta; 12-04-2013 at 02:01 AM.
    http://4nf.org/ - Ajaxify jQuery plugin

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles