Skip to content

Instantly share code, notes, and snippets.

@chzyer
Created January 10, 2013 18:46
Show Gist options
  • Save chzyer/4504688 to your computer and use it in GitHub Desktop.
Save chzyer/4504688 to your computer and use it in GitHub Desktop.
用JQuery执行JS代码

JQ全名jquery,一个javascript的框架. JQ内部集成了一个可以执行文本形式的JS代码,但是没有在API中列出来 于是,此篇文章变为了,备忘录

var code="alert('JS代码在这里')";
jQuery.globalEval(code) //将会弹出对话框
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment