View Full Version : open a html page inside div when click on links
ravimmrk
05-26-2008, 10:43 AM
with out refreshing the page i would like to load the another html page inside by page using DIV.. how i can do that..
1.already i have mainmenu left, when click the link in menu another html should be load in rightside of my page which contains a container DIV.
how i can do that, i tried XMLHttpRequest.. but its working fine in local machine, when i put in server its not working for IE6. in local machine its working for all browser..
please let me any other method..
its urgent for me..
thanks in advance...
midhul
05-26-2008, 01:43 PM
hi,
well you can use the dynamic ajax content (http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm) at dynamic drive it is in your site format!
molendijk
05-26-2008, 02:05 PM
You could try this (http://www.dynamicdrive.com/forums/showthread.php?t=31541), or this (http://www.dynamicdrive.com/forums/showthread.php?t=30079), or this (http://www.dynamicdrive.com/forums/showthread.php?t=29559).
(Midhul, ravimmrk doesn't want 'dynamic ajax content', because he doesn't want ajax).
---
Arie Molendijk.
ravimmrk
05-27-2008, 04:58 AM
hi,
well you can use the dynamic ajax content (http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm) at dynamic drive it is in your site format!
------------
thanks for help.. but the prob with that was its working fine.. in ie6 but not working in ie7.. in local and server...
any solution for that...
Medyman
05-27-2008, 02:41 PM
Well, the script works in IE7. So, it has nothing to do with it when it's properly implemented. You should create a new thread in the proper forum (http://dynamicdrive.com/forums/forumdisplay.php?f=2), post your code and/or a link to your site and someone will be better able to help you.
ravimmrk
05-31-2008, 09:37 AM
Below given is the code....
var bustcachevar=1 //bust potential caching of external pages after initial request? (1=yes, 0=no)
var loadedobjects=""
var rootdomain="http://"+window.location.hostname
var bustcacheparameter=""
function ajaxpage(url, containerid){
var page_request = false
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
}
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
page_request.onreadystatechange=function(){
loadpage(page_request, containerid)
}
if (bustcachevar) //if bust caching of external page
bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
page_request.open('GET', url+bustcacheparameter, true)
page_request.send(null)
}
function loadpage(page_request, containerid){
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
document.getElementById(containerid).innerHTML=page_request.responseText
}
function loadobjs(){
if (!document.getElementById)
return
for (i=0; i<arguments.length; i++){
var file=arguments[i]
var fileref=""
if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding
if (file.indexOf(".js")!=-1){ //If object is a js file
fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript");
fileref.setAttribute("src", file);
}
else if (file.indexOf(".css")!=-1){ //If object is a css file
fileref=document.createElement("link")
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", file);
}
}
if (fileref!=""){
document.getElementsByTagName("head").item(0).appendChild(fileref)
loadedobjects+=file+" " //Remember this object as being already added to page
}
}
}
jscheuer1
05-31-2008, 03:45 PM
That is this DD script:
http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm
If you are using it without the credit (as it appears in your post):
Your page is in violation of Dynamic Drive's usage terms (http://www.dynamicdrive.com/notice.htm), which, among other things, state that the script credit must appear in the source code of the page(s) using the script. Please reinstate the notice first.
For future reference:
Warning: Please include a link to the DD script in question in your post. See this thread (http://www.dynamicdrive.com/forums/showthread.php?t=6) for the proper posting format when asking a question.
Start a new thread in the DD scripts help section:
http://www.dynamicdrive.com/forums/forumdisplay.php?f=2
closing this thread.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.