使用jquery.get的jquery问题 [英] jquery problem using jquery.get

查看:99
本文介绍了使用jquery.get的jquery问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用jquey.get从其他页面获取结果。

问题是我也在该页面中获得样式和脚本标记。



i简单想要文本值:



for eaxmple我得到的查询输出是



< script src =abc.js/>

hiii



但我只希望hiii作为输出而不是脚本和风格在该页面中调用的标签



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

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

推荐答案

(文件).ready(function(){
( document ).ready(function() {


.get(http://localhost/video/b.php,function(data){
alert(data) ;
});
});
< / script > k
< div class = result < span class =code-keyword>> < / div >

和b.php

< < span class =code-leadattribute> link type = text / css rel = stylesheet <跨度class =code-attribute> href = http://s.codeproject.com/App_Themes /CodeProject/Css/Main.min.css?dt=2.7.131211.1\">
hiii

i获取

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

hiii
.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


这篇关于使用jquery.get的jquery问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆