我的ajax(jquery)响应(html)给了我一大堆html源代码,因为它获取了enrite页面.
响应有点像下面:
<html>
<head>
...
...
</head>
<body>
.
.....
.
.......
<div id="content">
content i want to extract
</div>
.............
..........
.............
</body>
</html>
我需要以下方面的帮助:
1)是否可以阅读之间的任何内容<div id='content'></div>?如果有,怎么样?
2)如果#1不可能,我怎样才能从中提取内容<div id='content'></div>?
我试过的代码:
/*Ajax*/
$jq(function(){
alert ("Doc ready");
$jq("#content a.next-page").bind("click", function(e){
alert ("Hey!");
/*Make the call*/
$jq.ajax({
url: "/page/2",
type: "get",
cache: false,
data: "",
error: function(){alert ("No data found for your search.");},
success: function(results){
//$searchPanel.find("tbody").empty().append(results);
//$searchPanelHolder.css({"display":"block"});
alert (results.find("div[id='content']").html());
e.preventDefault();
}
});
e.preventDefault();
});
});
对此有任何帮助非常感谢
非常感谢,Racky
我想在Silverlight 4中为我的(编辑)按钮构建一个模板.因此,我想将图像作为嵌入式资源包含在内.
所以我的问题是:如何在模板中使用嵌入式资源图像作为我的按钮?
ControlTemplate(TargetType ="Button")位于一个外部Ressources.xml中.
Christoph
以下问题:
我创建一个查询来显示MYSQL表的所有条目,如果我编辑一个字段并再次执行查询,我会得到与第一个查询相同的(旧)结果.
似乎Hibernate缓存了Result.我试图禁用缓存
query.setCachable(假)
"hibernate.cache.use_second_level_cache"
"cache.provider_class"
"org.hibernate.cacheable"
刷新和关闭会话
但没有任何作用
我确信我不是第一个遇到这种冲突的人.
我继承的代码执行以下操作:
org.w3c.dom.Document dom; // declaration
javax.xml.validation.Schema schema; // declaration
...
...
...
javax.xml.validation.Validator validator = schema.newValidator();
validator.validate(new DOMSource(dom));
Run Code Online (Sandbox Code Playgroud)
其中...代表看似不重要/无关代码
使用JDK 6编译和运行代码可以工作(并且始终有......)
最近,我不得不将我公司其他地方编写的另一个组件集成到我的代码中.该组件绝对需要包含在类路径中xercesImpl-2.8.1.jar
我绝对需要这个第三方组件,但现在运行上面的代码不再有效,我得到以下内容:
org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'Root'.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
at org.apache.xerces.jaxp.validation.DOMValidatorHelper.beginNode(Unknown Source)
at org.apache.xerces.jaxp.validation.DOMValidatorHelper.validate(Unknown Source)
at org.apache.xerces.jaxp.validation.DOMValidatorHelper.validate(Unknown Source)
at org.apache.xerces.jaxp.validation.ValidatorImpl.validate(Unknown Source)
at javax.xml.validation.Validator.validate(Validator.java:127)
Run Code Online (Sandbox Code Playgroud)
作为一个解决方案,我想也许以某种方式在自己的类加载器中屏蔽xercesImpl-2.8.1.jar,但是没有设法这样做,可能是因为缺乏类加载器知识或者可能是因为它不是要走的路.关于我的环境的另一件事,我的应用程序运行在tomcat 5.5和6 ...
顺便说一下调试时我注意到我跑的时候 dom.getImplementation()
xercesImpl-2.8.1.jar …您好我正在尝试使用C#反射来调用传递参数的方法,并作为回报传递回结果.我怎样才能做到这一点?我尝试了几件事但没有成功.我已经习惯了PHP和Python,这可以在一行上完成,所以这对我来说非常困惑.
实质上,这就是如何在没有反射的情况下进行调用:
response = service.CreateAmbience(request);
Run Code Online (Sandbox Code Playgroud)
请求有以下对象:
request.UserId = (long)Constants.defaultAmbience["UserId"];
request.Ambience.CountryId = (long[])Constants.defaultAmbience["CountryId"];
request.Ambience.Name.DefaultText = (string)Constants.defaultAmbience["NameDefaultText"];
request.Ambience.Name.LanguageText = GetCultureTextLanguageText((string)Constants.defaultAmbience["NameCulture"], (string)Constants.defaultAmbience["NameText"]);
request.Ambience.Description.DefaultText = (string)Constants.defaultAmbience["DescriptionText"];
request.Ambience.Description.LanguageText = GetCultureTextLanguageText((string)Constants.defaultAmbience["DescriptionCulture"], (string)Constants.defaultAmbience["DescriptionDefaultText"]);
Run Code Online (Sandbox Code Playgroud)
这是我实现反射的函数,其中上面案例的serviceAction将是"CreateAmbience":
public static R ResponseHelper<T,R>(T request, String serviceAction)
{
ICMSCoreContentService service = new ContentServiceRef.CMSCoreContentServiceClient();
R response = default(R);
response = ???
}
Run Code Online (Sandbox Code Playgroud) Are there any Difference between const char* p and char const* p
Run Code Online (Sandbox Code Playgroud) 我需要一个正则表达式匹配的标签,看起来像<A>,<BB>,<CCC>,但不<ABC>,<aaa>,<>.所以标签必须由相同的大写字母组成,重复.我试过了<[A-Z]+>,但那不起作用.当然我可以写类似的<(A+|B+|C+|...)>等等,但我想知道是否有一个更优雅的解决方案.
我正在编写备份服务来备份SQL数据库并将其保存在云存储中.我实际上已经在Amazon S3上实现了这个功能,但是当应用程序将分发给客户时,我无法将API密钥与应用程序一起存储.我考虑使用网络服务提供密钥,但目前这不是我最好的选择(因为它仍然存在密钥被盗的可能性.)
因此,我正在研究Windows Azure,即Blob服务,并看到他们拥有这些共享访问签名,可用于提供对云中资源的访问.您还可以使用签名将blob放入云中.但通过MSDN文档阅读,我不禁认为这是一个不安全的系统.知道的任何人1.我的帐户的容器的确切名称和2.如何形成签名将能够访问对象.使用此签名时,您不需要密钥.至少这是我对阅读文档的印象.
最后是我的问题.我对Azure的共享访问签名的评估是否正确,如果没有,为什么?任何人都可以提出另一种方法来做我想要完成的事情.
java ×3
c# ×2
hibernate ×2
.net ×1
azure ×1
c ×1
caching ×1
cloud ×1
html ×1
image ×1
javascript ×1
jdk1.6 ×1
jquery ×1
mysql ×1
reflection ×1
regex ×1
silverlight ×1
validation ×1
xerces ×1
xml ×1