MarkMan55 Posted February 8, 2007 Share Posted February 8, 2007 I'm using AJAX and making a call to load a file in a div. The problem I'm having is making the file/document display at an anchor point. Ex: page1.html has four anchors and I want to use use AJAX to load the doc into a div and have it display at anchor point 3. When I make a call to load the page, nothing happens in IE6 and the page just loads at the top in Firefox. Here is some example code: function ajax() { var args = ajax.arguments; switch (args[0]) { case "load": if (document.getElementById) { var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest(); } if (x) { x. /> { if (x.readyState == 4 && x.status == 200) { el = document.getElementById(args[2]); el.innerHTML = x.responseText; } } x.open("GET", args[1], true); x.send(null); } break; case "clear": el = document.getElementById(args[2]); el.innerHTML = ""; break; } } ...... <span return openNew(this.href);" href="http://www/" rel="nofollow" target="_blank">http://www.<anywhere>.com/dir/doc1.html#anchor1', 'displaydiv');">see document below</span> <div id="displaydiv"></div> ... and the code for the "doc1.html" file being loaded: <a id="anchor1"></a> text...... <a id="anchor2"></a>text...... <a id="anchor3"></a>text...... <a id="anchor4"></a>text...... <a id="anchor5"></a>text...... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.