- returning undefined in bookmarklet - forwards page
- javascript:void((function(){
- var s = document.createElement('script');
- s.setAttribute('language','javascript');
- s.setAttribute('src','http://localhost:3000/script/bookmarklet.js');
- document.body.appendChild(s);
- })());
- javascript:(function(){
- var s = document.createElement('script');
- s.setAttribute('language','javascript');
- s.setAttribute('src','http://localhost:3000/script/bookmarklet.js');
- document.body.appendChild(s);
- void(0);
- })();
- (function() {
- function create_form() {
- var path = "http://localhost:3000/links";
- var newform = document.createElement('form');
- newform.setAttribute("method", "post");
- newform.setAttribute("action", path);
- newform.setAttribute("accept-charset","UTF-8");
- var title_hidden_field = document.createElement("input");
- title_hidden_field.setAttribute("type","hidden");
- title_hidden_field.setAttribute("name", "link[title]");
- title_hidden_field.setAttribute("value", "Test Title");
- newform.appendChild(title_hidden_field);
- var url_hidden_field = document.createElement("input");
- url_hidden_field.setAttribute("type","hidden");
- url_hidden_field.setAttribute("name", "link[url]");
- url_hidden_field.setAttribute("value", "http://www.example.com");
- newform.appendChild(url_hidden_field);
- document.body.appendChild(newform);
- newform.submit();
- };
- create_form();
- })();
- var myiframe = document.createElement('iframe');
- myiframe.scrolling = "no";
- myiframe.name = "myiframe";
- myiframe.id = "myiframe";
- myiframe.src = "blank.html"; //so your users wont have to use their bandwith much, I think you can also set it to the about page in many browsers
- myiframe.width = "0px"; //so it becomes invisible
- myiframe.height = "0px"; //""
- document.body.appendChild(myiframe)
- var ThisBody = document.body.innerHTML
- ThisBody += '<iframe frameborder="0" scrolling="no" name="myiframe" id="myiframe" src="blank.html" width="0px" height="0px"></iframe>
- newform.target = "document.getElementById('myiframe')" //our iframe
- javascript:(function(){
- var s = document.createElement('script');
- s.setAttribute('language','javascript');
- s.setAttribute('src','http://localhost:3000/script/bookmarklet.js');
- document.body.appendChild(s);
- })();void(0)
- newform.onsubmit = function(event) {
- event.preventDefault();
- // Create XMLHttpRequest object and send data.
- }