草庐IT

start-domain

全部标签

javascript - "Protocols, domains, and ports must match"问题

当我在控制台上查看时,我的网站有这些错误消息。谁能告诉我通常导致这些错误消息的问题是什么?Blockedaframewithorigin"mysite"fromaccessingaframewithorigin"facebook".Theframebeingaccessedset"document.domain"to"facebook",buttheframerequestingaccessdidnot.Bothmustset"document.domain"tothesamevaluetoallowaccess.contentscript_siteoverlay_bin.js:78B

javascript - 模拟 :starts-with or :ends-with for searching text? 的 jQuery 选择器

如果您查看selectorslist在jQuery网站上,有用于属性开始和结束的选择器。还有一个用于搜索文本的:contains选择器:alert($("div").find("span:contains(text)").html());jQuery是否有使用开头或结尾来搜索字符串的实现?仅供引用:我需要搜索XML对象。 最佳答案 据我所知不是默认情况下,但您可以通过$.expr[":"]添加自己的伪选择器:http://jsfiddle.net/h6KYk/.$.extend($.expr[":"],{"starts-with":

javascript - 如何让 Greasemonkey 脚本同时在@run-at document-start 和@run-at document-end 运行?

对于我的Greasemonkey脚本,有一部分代码应该在页面加载之前运行(@run-atdocument-start),另一部分代码应该在文档加载之后运行已加载(@run-atdocument-end)。这可能吗?脚本运行的第一部分页面加载完毕,文档准备就绪脚本运行的第二部分我不想为此使用jQuery。我尝试了onload事件,但没有成功。我认为如果文档还没有,就不能附加事件?window.document.onload=function(e){alert("document.onload");} 最佳答案 您想要的事件是DOMCo

javascript - 有循环 "start-over"吗?

有continue;停止循环并移动到下一个循环有break;停止循环并移动到循环的结尾难道没有某种start;可以停止循环并移动到循环的开始吗?我知道只需修改i的值即可轻松实现所有这三个操作,但我总是尝试寻找已经内置的函数。 最佳答案 将循环变量的值重置为初始值,然后调用continue就可以了。例如:for(vari=0;i 关于javascript-有循环"start-over"吗?,我们在StackOverflow上找到一个类似的问题: https://

javascript - 谷歌浏览器插件 : How to get domain from URL (tab. 网址)

使用GoogleChromeAPI的tab.urlvalue,从整个值中获取域的最佳方法是什么?在JavaScript中,我会使用window.location.protocol和window.location.hostname。例如这样的事情:vardomain=window.location.protocol+"//"+window.location.hostname;但是那获取的是扩展域而不是选项卡,所以不能使用该方法。因此,使用类似于下面的函数...我如何从tab.url值中删除域?functionshow_alert(){chrome.tabs.getSelected(nul

javascript - 即使正确设置了 document.domain,跨子域 ajax 请求也被拒绝

在我的应用程序中,我在一个子域(dev.u413.com)上有一个网站,我使用jQuery向另一个子域(api.u413.com)上的JSONapi发出ajax请求。当我检查Chrome开发工具和FirefoxFirebug中的请求时,我的请求似乎被Access-Control-Allowed-Origin阻止了。我将document.domain设置为当前域的后缀:document.domain='u413.com';。这是我的要求:$.ajax({dataType:'json',data:{parseAsHtml:true,cli:'help'},url:'http://api.u

javascript - 设置 document.domain 是否适用于所有(大多数)浏览器?

SameOriginPolicyDocumentation是这样说的:Thereisoneexceptiontothesameoriginrule.Ascriptcansetthevalueofdocument.domaintoasuffixofthecurrentdomain.Ifitdoesso,theshorterdomainisusedforsubsequentoriginchecks.Forexample,assumeascriptinthedocumentathttp://store.company.com/dir/other.htmlexecutesthefollowin

javascript - (Web Audio API) 振荡器节点错误 : cannot call start more than once

当我启动振荡器时,将其停止,然后再次启动;我收到以下错误:UncaughtInvalidStateError:Failedtoexecute'start'on'OscillatorNode':cannotcallstartmorethanonce.显然我可以使用gain来“停止”音频,但我觉得这是一种糟糕的做法。什么是停止振荡器同时能够再次启动它的更有效方法?代码(jsfiddle)varctx=newAudioContext();varosc=ctx.createOscillator();osc.frequency.value=8000;osc.connect(ctx.destina

php - PHP 的 set_include_path 的 "Starting Point"是什么

在PHP中,set_include_path相对于什么?它是PHP.exe所在的文件夹吗?是网盘吗?换句话说,set_include_path('/')或set_include_path('.')指的是什么文件夹? 最佳答案 相对路径从文件的位置解析,其中include或使用include_path的另一个函数用于(参见descriptionofinclude_path):Usinga.intheincludepathallowsforrelativeincludesasitmeansthecurrentdirectory.Howe

PHP session_start() 导致 HTTP 请求挂起

我有一个从头开始用PHP编写的应用程序。我正在使用PHP的nativesession处理函数来处理用户身份验证和持久性。在开发服务器上进行测试时,一切都很顺利。身份验证、持久性等工作正常。当安装在生产服务器上时,一切正常,直到用户身份验证——当应用程序实际将数据写入session对象时,突然,紧随其后的HTTP请求在执行session_start()时完全挂起。我怀疑临时session文件被PHP锁定并且从未释放,所以我尝试使用session_write_close()跟踪应用程序写入session对象的位置,但没有成功似乎没有任何影响。这听起来像是文件锁定问题还是其他问题?我很困惑为