这是困扰我的代码.我需要找到代码并替换为Fancybox代码,但它抛出一个错误:win未定义
替换mywin值
<cfsavecontent variable="x">
mywin = window.open (url,"win",'toolbar=yes,location=yes,resizable=yes,copyhistory=yes,scrollbars=ye?s,width=878,height=810');
</cfsavecontent>
Run Code Online (Sandbox Code Playgroud)
对此:
mywin = $.fancybox('href' :url,'width': '500');
Run Code Online (Sandbox Code Playgroud)
我这样想
<cfset a = Replace(x,"mywin = window.open (url,"win",'toolbar=yes,location=yes,resizable=yes,copyhistory=yes,scrollbars=yes,width=878,height=810');","$.fancybox()","one")>
Run Code Online (Sandbox Code Playgroud)
更新代码:
<cfsavecontent variable="foo">
function setmycode() {
url = "http://myurl.com?thestep=9&sortBy=1&sortOrder=1";
mywin = window.open (url,"win",'toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,resizable=yes,copyhistory=yes,scrollbars=yes,width=878,height=810');
mywin.focus();
return false;
}
</cfsavecontent>
<cfset a = Replace(foo,"mywin = window.open (url,""win"",'toolbar=yes,location=yes,resizable=yes,copyhistory=yes,scrollbars=yes,width=878,height=810');","$.fancybox()","one")>
<cfdump var="#a#">
Run Code Online (Sandbox Code Playgroud) coldfusion ×1