Load a full page with Ajax.
I'm creating a web site.It have many pages with scripts and style sheets.
But I wish to use same banner and nevigation bar and other common features for all pages. (frame of my web site).So I wish to use ajax technology to load sub pages without reloading frame.
I know about placing a page on <div> tag with responseText methord.
But it doesn't load any scripts which are place on sub pages.
Can you help to load pages with scripts and style sheets?:confused:
Re: Load a full page with Ajax.
Are you saying that when you load the pages with ajax, the code on the loaded page doesnt work?
Can you post your code please?
Re: Load a full page with Ajax.
Quote:
Originally Posted by thamizhinpan
I'm creating a web site.It have many pages with scripts and style sheets.
But I wish to use same banner and nevigation bar and other common features for all pages. (frame of my web site).So I wish to use ajax technology to load sub pages without reloading frame.
I know about placing a page on <div> tag with responseText methord.
But it doesn't load any scripts which are place on sub pages.
Can you help to load pages with scripts and style sheets?:confused:
Do not use AJAX for navigation. What if the user has disabled Javascript - what if you need to provide a direct link to the page? Many other reasons too.
You can use CSS to archive a common theme.
1 Attachment(s)
Re: Load a full page with Ajax.
Quote:
Originally Posted by dclamp
Are you saying that when you load the pages with ajax, the code on the loaded page doesnt work?
Can you post your code please?
Here is my testing documents.
Re: Load a full page with Ajax.
Your test page needs to include the other script. SayHello(). Other wise it won't work. Looking at your code; there are two concerns.
- innetHTML should not be used to add HTML. The DOM provides the methods to do this; i.e: importNode
- Generating a sessionID on the client side leaves sessions open to hijacking.
All you need to do to fix it is add an extra HTML tag to your main HTML.
HTML Code:
<script language="javascript" src="sayhello.js"></script