Click here to Skip to main content
15,914,222 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
i am using jquey.get to get result form other page .
problem is that i also get style and script tag include in that page.

i simple want text value:

for eaxmple what i get output of query is

<script src="abc.js"/>
hiii

but i want only hiii as output not script and style tags called in that page

XML
code for index.php

<script src="jquery-1.10.2.js"></script>
<script>
$( document ).ready(function() {
    $.get( "http://localhost/video/b.php", function( data ) {
        alert(data );
    });
});
</script>k
<div class="result"></div>

and b.php

<link type="text/css" rel="stylesheet" href="http://s.codeproject.com/App_Themes/CodeProject/Css/Main.min.css?dt=2.7.131211.1">
hiii

i get

<link type="text/css" rel="stylesheet" href="http://s.codeproject.com/App_Themes/CodeProject/Css/Main.min.css?dt=2.7.131211.1">

hiii
Posted
Updated 13-Dec-13 5:30am
v2
Comments
Sampath Lokuge 13-Dec-13 11:11am    
Can you put your js code ?
garav kumar mishra 13-Dec-13 11:23am    
code for index.php

<script src="jquery-1.10.2.js"></script>
<script>
$( document ).ready(function() {
$.get( "http://localhost/video/b.php", function( data ) {
alert(data );
});
});
</script>k
<div class="result"></div>

and b.php

<link type="text/css" rel="stylesheet" href="http://s.codeproject.com/App_Themes/CodeProject/Css/Main.min.css?dt=2.7.131211.1">
hiii

i get

<link type="text/css" rel="stylesheet" href="http://s.codeproject.com/App_Themes/CodeProject/Css/Main.min.css?dt=2.7.131211.1">

hiii

in alert but i want only hiii as output
Peter Leow 13-Dec-13 11:52am    
Could you show us the complete code for the b.php?
hschillig 13-Dec-13 13:26pm    
Why do you have styles on an ajax page to begin with? If it's never going to display to the user, I'm confused on why they are included in that page.

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