0

I have build this page. when you click on a row in the table, the page send an ajax request for data and then dynamically creates a script in the body called which loads the graph. It works in all chrome and FF but not in IE8. meaning -when you click on on row it work's but the second row and on the script are not loading.. I don't even know how to debug it in IE8. can someone recommend a solution? :-)

the script that loads the other scripts is

$.post("shorts.server.php", $.param({
     val: stocknumber,
     id: id,
     name: stockname,
     group: stockgroup
 }), function (response) {
     //alert(response);
     // We dynamically add javascript headers
     var head = document.getElementsByTagName('body')[0];
     script = document.createElement('script');
     //dynamic_graph.js changes it's content by the current selected stock
     //see shorts.server.php for details
     script.src = 'jQuery/head/dynamic_graph.js';
     head.appendChild(script);
     script = document.createElement('script');
     //dynamic_graph.js changes it's content by the current selected stock
     //see shorts.server.php for details
     script.src = 'jQuery/head/dynamic_info.js';
     head.appendChild(script);
 });
4
  • 3
    How can we not love the title? It just says it all! "javascript jquery" perfect! wait, what about "javascript jquery question" ? Commented May 16, 2012 at 13:58
  • @gdoron not any more :-) Commented May 16, 2012 at 13:59
  • 1
    @ManseUK. You ruined one of my best comment... :) Commented May 16, 2012 at 14:00
  • Aren't you supposed to have 'var head = document.getElementsByTagName('head')[0];' instead of 'var head = document.getElementsByTagName('body')[0];'?? That might solved the issue, althought I'm not sure about this one... Commented May 16, 2012 at 14:01

2 Answers 2

2

Try to use jQuery.getScript:

function(response)
{
     $.getScript('jQuery/head/dynamic_graph.js');
     $.getScript('jQuery/head/dynamic_info.js');
}
Sign up to request clarification or add additional context in comments.

Comments

0

In IE9 press F12 to run the debugger. In the debugger you can select the browser mode like : IE8. Use Jquery for all your DOM interactions and browser compatibility.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.