javascript 这是什么意思:SCRIPT1006:预期的')'
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12457827/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
what does this mean: SCRIPT1006: Expected ')'
提问by charlie_cat
I have a controller:
我有一个控制器:
public ActionResult Detail(string title, string directory)
{
ScormModule module = ZincService.ScormService.GetScormModule(title, directory);
if (module != null)
{
ViewBag.TrainingModuleId = module.ScormModuleId;
ViewBag.ScormModuleUrl = module.RelativeHtmlPath + '/' + module.EntryPointRef;
ViewBag.WindowWidth = module.LaunchWidth;
ViewBag.WindowHeight = module.LaunchHeight;
ViewBag.title = module.Title;
return View(module);
}
else
return RedirectToAction("Index", "Scorm", new { area = "Admin" });
}
then Detail.aspx file where i call a javascript function:
然后是我在其中调用 javascript 函数的 Detail.aspx 文件:
<div class="col3">
<a id="training-launch-button" href='javascript:OpenScormModuleWindow("<%: ViewBag.ScormModuleUrl %>", <%: ViewBag.title %>, <%: ViewBag.WindowWidth %>, <%: ViewBag.WindowHeight %>);' class="button">Launch</a>
</div>
Then OpenScormModuleWindow:
然后打开ScormModuleWindow:
function OpenScormModuleWindow(trainingModuleUrl, title, width, height)
{
console.log(trainingModuleUrl);
trainingModuleWindow = window.open(trainingModuleUrl, title, "width=" + width + ", height=" + height);
trainingModuleWindow.focus();
}
ViewBag.ScormModuleUrl = "/SCORM/SellingWindows/a001index.html"
ViewBag.ScormModuleUrl = "/SCORM/SellingWindows/a001index.html"
I never get the output of console.log(trainingModuleUrl);
when i hit the launch button i get the error in question and it point to some weird line that is nowhere in my code?
console.log(trainingModuleUrl);
当我点击启动按钮时,我从来没有得到输出,我得到了有问题的错误,它指向我的代码中没有任何地方的一些奇怪的行?
var _waxArr; var o = document.getElementById('cosymantecbfw');
o.addEventListener('waxSetArr', function(evt) { _waxArr = evt.detail; });
function waxGetElement(i) { return _waxArr[i]; }
i searched for this code but does not find it
我搜索了此代码,但没有找到
can someone help please? thanks
有人可以帮忙吗?谢谢
回答by dxh
Note the "co[symantec]bfw".
请注意“co[ symantec]bfw”。
I think this can be traced to a Norton plugin in your browser.
我认为这可以追溯到浏览器中的诺顿插件。
回答by Bojan Kaurin
Does your title have any spaces?
你的标题有空格吗?
If it does, try this
如果是这样,试试这个
<div class="col3">
<a id="training-launch-button" href='javascript:OpenScormModuleWindow("<%:ViewBag.ScormModuleUrl %>", "<%: ViewBag.title %>", <%: ViewBag.WindowWidth %>, <%: ViewBag.WindowHeight %>);' class="button">Launch</a>
</div>