List Info

Thread: div how




div how
user name
2006-07-20 17:00:17
hi gaiz :::

i have devision <div></div>  how i can include
inside it apage ????? so
the page will not get refresh !!! 

thanx in advance !!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "PHP-Masters" group.
To post to this group, send email to PHP-Mastersgooglegroups.com
To unsubscribe from this group, send email to
PHP-Masters-unsubscribegooglegroups.com
For more options, visit this group at http://gro
ups.google.com/group/PHP-Masters
-~----------~----~----~----~------~----~------~--~---

div how
user name
2006-07-20 21:04:08
Ajax my friend. Give the div an id, <div
id="nameDiv"></div>

then have some javascript in the <head> tag that looks
like this:
<script language="javascript">
<!--

function createObject(){
    var ro;
    var browser = navigator.appName;
    if(browser == "Microsoft Internet
Explorer"){
        ro = new
ActiveXObject("Microsoft.XMLHTTP");
    }else{
        ro = new XMLHttpRequest();
    }
    return ro;

}

var http=createObject();

function makefile(includePage) {

    http.open('get', includePage);
    http.onreadystatechange = handleConts;
    http.send(null);
}

function handleConts() {
    if(http.readyState == 4){
        var response = jim.responseText;

   
document.getElementById("nameDiv").innerHTML=res
ponse;

    }
}


//-->
</script>
To use this just have a link that looks like this:
<a
href="javascript:makefile('include.inc')">P
age name</a>
just change include.inc and the name of the DIV to whatever
you have it 
set... FYI this will work with any file name you put into
makefile... 
and if you want you can use onload things to make it load on
the beginning

Beshoo wrote:
> hi gaiz :::
>
> i have devision <div></div>  how i can
include inside it apage ????? so
> the page will not get refresh !!! 
>
> thanx in advance !!
>
>
> >
>
>   

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "PHP-Masters" group.
To post to this group, send email to PHP-Mastersgooglegroups.com
To unsubscribe from this group, send email to
PHP-Masters-unsubscribegooglegroups.com
For more options, visit this group at http://gro
ups.google.com/group/PHP-Masters
-~----------~----~----~----~------~----~------~--~---

div how
user name
2006-07-20 21:26:41
Wow, great code... I am going to use this.. and I wasnt even
looking
for it... Thanks a lot.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "PHP-Masters" group.
To post to this group, send email to PHP-Mastersgooglegroups.com
To unsubscribe from this group, send email to
PHP-Masters-unsubscribegooglegroups.com
For more options, visit this group at http://gro
ups.google.com/group/PHP-Masters
-~----------~----~----~----~------~----~------~--~---

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )