SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2004
    Location
    Brazil
    Posts
    91
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    IE getting closed when I append a new script tag...

    Hey guys,

    I am trying to append a new script tag when i click on a certain link, but IE crashes when I execute the function! Firefox works fine as always

    Here´s the code:

    HTML Code:
    	function loadContactValidation() {
    	
    		var getHeadTag = document.getElementsByTagName('head')[0];
    	
    		var setjs = document.createElement('script');
    		getHeadTag.appendChild(setjs);	
    		
    		setjs.setAttribute('type', 'text/javascript');
    		setjs.setAttribute('src', 'js/loadContactValidate.js');
    
    	}
    
    
    [

    Any help, please?

  2. #2
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That code itself does not crash. What you need to do is to remove things from your page and reload if it crashes. If no crash, then remove more stuff until you find out what is exactly causing the crash.

    First step would be to empty the loadContactValidate.js and see if it crashes


Bookmarks

Posting Permissions

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