I have the code below in a .php file on my site. I would like to be able to type the link to the .php file in the address bar, and for the php script to run on the current page. How could I do this? PHP File:
<SCRIPT language=JavaScript>
javascript:document.开发者_StackOverflowbody.contentEditable='true'; document.designMode='on';void(0)
</script>
The way you suggest to do it it's not possible, but you can have a "bookmarlet" which is javascript code that you drag and drop to your bookmarks bar, and every time you click on it, it runs a script.
Try it here: http://jsfiddle.net/XtHsP/
精彩评论