草庐IT

woocommerce_locate_template

全部标签

javascript - 如何使用 window.location 获取子域?

如果我有一个主机名,例如:http://sample.example.com在Javascript中,我执行window.location.hostname,我会得到“example.com”还是“sample.example.com”?如果没有,我怎么能得到sample.example.com? 最佳答案 是的,window.location.hostname也会为您提供子域。如果这不起作用,或者某些其他浏览器不支持,您可以很容易地解析它://window.location.href=="http://sample.somedom

javascript - 在 WooCommerce 网站中接收重力形式错误

我的Chrome浏览器控制台中出现了两个问题。仅供引用,我使用的是WordPress3.9、GravityForms1.8.8和WooCommerceGravityAddOn(最新)。基本上,当我在我的网站上访问我的一个产品时(抱歉,它只在我的机器上本地运行),我收到以下两个错误:错误1:UncaughtReferenceError:gformisnotdefined错误2:UncaughtReferenceError:gformCalculateTotalPriceisnotdefined仅供引用,我正在使用WooCommerceGravityFormsAddOn,但在我的Gravi

javascript - history.back() 不会在 Chrome/FireFox 中更新 location.hash

我尝试构建一个JS脚本来更改页面的位置,然后返回直到找到特定的哈希位置:varStopAtThisHash='#';varCurrentHash=window.location.hash;varcontinueLoop=true;while((window.history.length>0)&&(continueLoop)){window.history.back();varNowWeAreAtHash=window.location.hash;//thisneverchangesinChrome//actually,alwaysseemsto:CurrentHash==NowWeAr

javascript - window.location.reload 后转到 anchor 链接

我正在尝试更新哈希,然后重新加载页面。$('a[name="'+fragment+'"]').remove();//don'tjumpbeforewindowreloadswindow.location.hash=fragment;window.location.reload(true);重新加载窗口后不会跳转到anchor标记。我该如何解决? 最佳答案 如果您要重新加载页面,这在jQuery中实现起来相当简单。加载页面时只需检查window.location.hash属性即可。$(document).ready(function(

javascript - window.location.hash 总是显示为空

在我的phonegap应用程序中,我更新了我的数据,因为我有以下代码,因为我得到了window.location.hash(*指示错误行)值将为空。functioninit(){$("#homePage").live("pageshow",function(){getDatas();});$("#editPage").live("pageshow",function(){***varloc=window.location.hash;***alert("loc"+loc);if(loc.indexOf("?")>=0){varqs=loc.substr(loc.indexOf("?")+

javascript - window.location.search 的跨站点脚本问题

几天以来,我一直在浏览这么多论坛和维基百科,试图了解XSS攻击,几乎我花了2-3天,但仍然没有更好的想法,因为专家建议了多种解决方案,我想知道黑客是如何可以在受害者浏览器上注入(inject)恶意代码吗?我的应用程序已用于在某些AppScanner标准测试工具上运行,因此它捕获了很多XSS问题。我想把我的应用程序的XSS问题之一放在这里,所以请有人帮助我了解我必须为这个问题做些什么。尽管如此,我还是做了很多尝试来更好地理解XSS问题。这是我的代码片段functiongetParameter(param){varval="";varqs=window.location.search;va

javascript - Angular JS 错误 : $compile:tpload: Failed to load template:

所以我试图在我的指令中加载模板。该指令是可重用的。但是我无法加载模板。我有其他模板可以加载并正常工作。我得到的错误是:GET/ClassificationToolkitForGrails/classificationviewer.html404(NotFound)angular.js:8521Error:[$compile:tpload]Failedtoloadtemplate:classificationviewer.html包含指令的javascript文件:/****/varclassificationViewModule=angular.module('ald.classifi

javascript - window.location.href 和 location.reload() 不从服务器加载更新的页面

我有一个表单正在通过AJAX调用进行更新。Ajax调用成功后,我想重新加载同一页面以反射(reflect)新的更改。在AJAX调用成功后,我使用了location.reload()和window.location.href,在浏览器上执行了正确的RELOAD,但表单显示旧的数据,不是新的。如果我使用浏览器的重新加载按钮重新加载页面,则会显示新更新的数据。但是如何使用jQuery正确地重新加载页面? 最佳答案 reload(forcedReload)方法接受一个bool标志,当它为真时,会导致页面始终从服务器重新加载。如果为false

javascript - Meteor Blaze 访问 Template.onCreated 中的 Template.contentBlock

我正在为child编写自定义Blazeblock助手:{{>Template.contentBlock..}}{{>Template.contentBlock..}}我的预期用例是拥有一个包含我在html文件中定义的任意子节点的模板。{{#parent}}{{#childid="child1"title="Child1"}}Thisiscontentofchild1{{/child}}{{#childid="child2"title="Child2"}}Thisiscontentofchild2{{/child}}{{#childid="childN"title="ChildN"}}T

javascript - Firefox 上的 window.open(url) 和 window.location.href = url 有什么区别?

我正在尝试构建一个小书签,将当前url作为参数提供给另一个url。但是我发现这javascript:(function(){window.open("http://www.somesi.te/some/thing?url="+encodeURIComponent(window.location.href))})()不起作用,而这javascript:(function(){window.location.href="http://www.somesi.te/some/thing?url="+encodeURIComponent(window.location.href)})()确实如此