Click here to Skip to main content
16,016,925 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi
i have a page with dives like:

<pre lang="HTML"> 

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


and i have function with jqurey like

JavaScript
function creatContent(){
	Pageid++;
	var newDiv='<div class="load" id="page'+Pageid+'"><div id="top"  önclick="ThisClose('+Pageid+')"> </div><div id="content"><div id="bottom" ></div></div> </div>';
	$("#home").after(newDiv);
}


$("#home").find("div").live({
		click:function(){
			var addr=$(this).attr('page');
			creatContent();
			$("#content").load("Pages/"+addr);
			hideDesktop();
			addTolbar(addr,Pageid);
			}	
		});


$("#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

http://upload.tehran98.com/img1/iszvg4aw08u9v640l7sv.png[^]
Posted
Updated 6-Jan-13 23:32pm
v3
Comments
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

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:
http://api.jquery.com/category/selectors/[^],
http://api.jquery.com/id-selector/[^].

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?

—SA
 
Share this answer
 
v2

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900