Click here to Skip to main content
15,888,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,
I have a file with name "product.htm". I want to load it in to the div. I use the command: ("div").load("product.htm");
But when I run the page, it encode my html file so load that file as a text.
Like <b> come &l.t;b&g.t;
How can i stop encoding to load it like a html?
Thanks in advance for your help.
Posted
Updated 8-Jun-11 2:54am
v4

This is a small example I just tried out and I can't find the error you encountered:
File: Test.html
XML
<html>
<head>
<script type="text/javascript" language="javascript">
</script>
</head>
<body onload="">
<h1>Hello world</h1>
</body>
</html>

This is the file that loads the former file:
File: LoadDiv.thml
XML
<!DOCTYPE html>
<html>
<head>
    <style>
    </style>
    <script src="http://code.jquery.com/jquery-1.5.js"></script>
</head>
<body>
    <div id="myTip" class=".div">This should be replaced with something from a file!</div>
    <script type="text/javascript">
        function loader()
       
            //alert("Hello!");
            $("#myTip").load("./Test.html");
        }
        window.setTimeout(loader, 1500);
    </script>
</body>
</html>

What are you getting if you call up the URL of product.html? Does it display correctly on its own?
Cheers!
-MRB
 
Share this answer
 
v2
Comments
Sandeep Mewara 8-Jun-11 11:39am    
My 5!
Thanks for your answer. I wont to get the html tags. No text of html. But I fix my problem without load. Thanks
 
Share this answer
 

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