Click here to Skip to main content
12,823,984 members (42,718 online)
Rate this:
Please Sign up or sign in to vote.
See more: jQuery
i have a page with dives like:

<pre lang="HTML"> 

                    <div id="connect" page="Conect.html" class="deskIcon">
                    <div id="message" page="Message.aspx"class="deskIcon">

and i have function with jqurey like

function creatContent(){
	var newDiv='<div class="load" id="page'+Pageid+'"><div id="top"  önclick="ThisClose('+Pageid+')"> </div><div id="content"><div id="bottom" ></div></div> </div>';

			var addr=$(this).attr('page');

$("#content") load the html page but it dosen't work for aspx pages how can i load a aspx page in $("#content") ?
Let's Me Explain in a image Check this img plz[^]
Posted 6-Jan-13 7:24am
Updated 7-Jan-13 0:32am
Christian Graus 6-Jan-13 15:33pm
What does 'doesn't work' mean ? Have you put break points in the aspx to see if it runs ? I don't see any reason for it not to, it's still a HTTP request all the same. There is no reason I can see for this to not work.
farham_heidari 6-Jan-13 15:37pm
load work for content.html but it dosen't work for message.aspx
Christian Graus 6-Jan-13 16:54pm
*sigh* you won't get help like this. Does it crash ? Is there an error in the browser ? Does the page get requested at all ? Have you made sure the URL is correct ?

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Well, I can see two problems so far:

If you use the selector $("#content"), it means that you need to have some element to find by id="content". You don't show such HTML element in your sample. Apparently, if you don't have it, the code won't work.

Please see:[^],[^].

The second thing depends on what do you have at the address pointed by the URL "Pages/" + addr. As you mention "load page" in the title of the question, it suggest there is a whole HTML page at this address. It cannot work, because the whole page could not be an inner HTML of HTML element. It can only work if this is a fragment of HTML, which is a valid HTML construct, so the whole thing after loading would meet the requirements defined by HTML schema.

The problem is that you don't show many of methods shown in this code fragment, so, who knows what other problems could be there?


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170308.1 | Last Updated 7 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100