开发者

Help Creating a bookmarklet out of this code

I'm really stuck here and I've tried a bunch of different solutions to try to fix the problem, but I can't seem to find a solution. The problem is that I'm trying to create a bookmarklet (a button that you press on a website that activates JavaScript code ie: http://erkie.github.com/) out of this code:

(div style="position: absolute; top: 0px; left: 0px; height: 100%; width: 100%; z-index: 100; ")  (embed src="http://www.netdisaster.com/fla/ufo.swf?mode=ufo&movie=ufo&destruction=massive&control=on&son=&linkTarget=_self&acces=http://www.netdisaster.com/fla/" quality="high" wmode="transparent" width="100%" height="100%") (/div)

I've tried variations such as:

javascript:document.getElementsByTagName('html')[0].innerHTML+="  (divstyle='position:absolute;left:0;top:0;right:20;bottom:0;width:100%;height:100%;z-index:420;')  (embedsrc='http://www.netdisaster.com/fla/ufo.swf?mode=ufo&开发者_如何学JAVA;destruction=massive&control=on&son='quality='High'wmode='transparent')  (/embed)  (/div")

and other ways such as replacing the spaces with %20, but I still can't seem to get it to work.

I found this site: when you click on the word "we" it produces something similar. I had to get rid of the carrot signs since it won't show up on this website if I have them.


You can try jQuery Bookmarklet Generator


Here is your div bookmarklet:

javascript:
document.getElementsByTagName("head")[0].innerHTML += '<div id="working" style="position: absolute; left:0; top:0; right:20; bottom:0; width:100%; height:100%; z-index:420;><embed src="http://www.netdisaster.com/fla/ufo.swf?mode=ufo&destruction=massive&control=on&son=" quality="High" wmode="transparent"></embed></div>';
void(0);

Check for '/" problems! Also, you don't want to get rid of spaces, they help you understand the code. And, I've put the div into "head" instead of "html" as it is simpler.

  1. Make the code in normal javascript.
  2. Go to http://dean.edwards.name/packer/
  3. Obfuscate the code so it is shorter.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜