• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

JS files loaded

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need to check JS files which are being loaded by my web application. Is there any debugger / monitor using which I can find this out. Also , when a webpage uses a JS file is it loaded in memory ?. If so , when is it unloaded.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The js file acts just like it is hard coded on the page like an include. It gets loaded when the page gets loaded from top to bottom.
 
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you type the following in browser address bar, it will give all js files current page uses. I did not tried it in NS, but in IE6 it works.
javascript:var scr=document.getElementsByTagName('script');var res='';for(var i=0;i< scr.length;i++){if( scr[i].src && scr[i].src !='')res += scr[i].src +'\n';}alert(res);
It does not include frames and iframes, thought - you would have to modify that line a little, if you want that too.
 
Satish Gopalakrishnan
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Folks.. The problem i seem to be having is i have an application that uses iframes and we used quite a bit of js files..the memory taken up by the IE seems to be increasing to something like 50MB. I am trying to find out why . Any help in this regard ??
 
Yuriy Fuksenko
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmm,
that is interesting, I just opened Task Manager, I have 5 IE opened -
JavaRanch, http://www.colormatch.dk/, My work, some news and msdn,
Task Manager shows 5 procceses, that take
26152K, 23880K, 21456K,31004K , 48272K
To compare, my ideaj has 388884K - about 8 times as much as the biggest IE.
I mean none of those bothers me at all... Are you sure there is a problem?
May be it is just your javascript perfomance?
Just FYI, some links on JavaScript perfomance:
http://msdn.microsoft.com/msdnmag/issues/01/12/web/toc.asp?frame=true
http://msdn.microsoft.com/library/en-us/dndude/html/dude100499.asp?frame=true
http://msdn.microsoft.com/library/en-us/dndude/html/dude1201.asp?frame=true
http://dhtmlkitchen.com/dhtml/performance/index.jsp
http://www.webreference.com/js/tips/browse.html?cat=pe&start=1
http://www.webreference.com/js/column34/methods.html
 
Yuriy Fuksenko
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Another idea -
Use File - Save as... IE will save all files your page uses in a separate folder, including js files. Than just look at this folder for *.js files - you will get them all.
 
Satish Gopalakrishnan
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks . This helps a lot. Let me do some testing and code cleanup now !!!
 
Satish Gopalakrishnan
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually the thing that led me to believe that memory is an issue is that the pages loaded much slower than they used to when initially. I checked the memory when the appln was initially launched was around 27 MB and it steadily increased . So I was wondering if the js files were being loaded in memory and if so whether there is any mechanism to destroy them programmatically
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Acctaching a js file is just like having the code sitting there on the page.
There is no way to kill anything,,Sounds like you need to rethink how you are doing some things.
 
if you think brussel sprouts are yummy, you should try any other food. And this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic