bookmarklet

Using jQuery UI in a Bookmarklet

99封情书 提交于 2019-12-04 17:41:40
In CoffeeScript, though this code is almost identical to JavaScript: tabs_html = "<div id='nm-container'><ul><li><a href='#tabs-1'>Guidelines</a></li><li><a href='#tabs-2'>Test</a></li></ul> <div id='tabs-1'><p>something1</p></div><div id='tabs-2'><p>something2</p></div></div>" $("#nm-toolbar").append(tabs_html) $("#nm-container").tabs() It doesn't work. Funny thing is it does work when trying the last line: $("#nm-container").tabs() from the console. I'm attaching the full code below. Note that I'm using CoffeeMarklet to generate the bookmarklet which seems to work only on chrome. s1 = window

Include a specific version of JQuery and a plugin without conflicting with the page's JavaScript library?

心已入冬 提交于 2019-12-04 17:13:22
TL;DR : I want to include a specific version of JQuery and a specific JQuery plugin that is associated with my inclusion of jQuery on multiple different sites where I know nothing about the JavaScript libraries/plugins used by them, without conflicts. Possible? How? The whole story : Let's say I want to build a Reddit platform where multiple sites can link to Reddit threads by including http://myredditplatform.com/reddit.js and having <a href="" data-reddit-thread-id="1234"></a> elements littered on the page. Once a user clicks on a link like that, I open reddit in a beautiful modal window.

Javascript Bookmarklet to replace text with a link

≯℡__Kan透↙ 提交于 2019-12-04 17:10:30
I have some text on an HTML page. Need a bookmarklet (no jQuery) that will find a segment of the text using regex, then replace it with a link with the text as a parameter Example before: aaa bbb ccc ddd Example after: aaa <a href="http:www.whatever.com?bbb">bbb</a> ccc ddd assuming we were looking for "bbb" This solution will crawl the DOM search for text nodes within the document elements, skipping any elements you want. For example, you probably want to skip <a> tags, as well as <script> tags and others. This way, you won't replace element nodes or essential page functionality. (function(){

Bookmarklet to submit page source to form

偶尔善良 提交于 2019-12-04 14:26:01
问题 I'm using a bookmarklet to send the current page source to a server function which then processes it (stores it, no information needs to be returned to the user). Warning: ugly Javascript ahead, it's not a language I normally need to use. Here's the bookmarklet, pretty-printed for ease of reading: javascript: (function () { var h = document.documentElement.innerHTML; function c(a, b) { var c = document.createElement("textarea"); c.name = a; c.value = b; d.appendChild(c) }(document), d =

Capture keypress in Javascript (Google Docs)

自闭症网瘾萝莉.ら 提交于 2019-12-04 14:11:31
I'm trying to write a little greasemonkey script/bookmarklet/what have you for Google Docs. The functionality I'd like to add needs a keypress/keyup/keydown event handler (one of those three). Unfortunately, Javascript isn't my forté, and I can't seem to capture (?) a keypress event to while in the edit pane. As a last resort, I've tried the following: javascript:(function(){ els = document.getElementsByTagName("*"); for(i=0;i<els.length;i++){ els[i].onkeypress=function(){alert("hello!");}; els[i].onkeyup=function(){alert("hello2!");}; els[i].onkeydown=function(){alert("hello3!");}; } })();

Javascript for conditional URL append or redirect based on window.location.href

戏子无情 提交于 2019-12-04 13:46:07
I am trying to make a bookmarklet that when clicked will check the URL of the current tab/window to see if it contains 'char1' and/or 'char2' (a given character). If both chars are present it redirects to another URL, for the other two it will append the current URL respectively. I believe there must be a more elegant way of stating this than the following (which has so far worked perfectly for me) but I don't have great knowledge of Javascript. My (unwieldy & repetitive) working code (apologies): if (window.location.href.indexOf('char1') != -1 && window.location.href.indexOf('char2') != -1) {

bookmarklet that works on 2 pages

こ雲淡風輕ζ 提交于 2019-12-04 12:06:53
I'm using a bookmarklet to inject javascript into a webpage. I am trying to login into my gmail account(that part works) and in my gmail account automatically click Sent folder as the page loads. This is the starting page: This is the code I am using in bookmarklet: javascript: document.getElementById('Email').value='myEmail@gmail.com'; document.getElementById('next').click(); setTimeout(function(){ document.getElementById('Passwd').value='myPassword'; document.getElementById('signIn').click();},1000); setTimeout(function(){ document.getElementsByClassName("J-Ke n0 aBU")[0].click(); },6000); J

Create a Delicious Bookmarklet in Firefox using Delicious API

不想你离开。 提交于 2019-12-04 10:07:41
I want to create a Delicious bookmarklet in Firefox that bookmarks the current page with a predefined tag. For proof of concept, if I enter this url, it works: https://john:pwd@api.del.icio.us/v1/posts/add?url=http://www.google.com& description=http://www.google.com&tags=testtag But this as a bookmarklet doesn't, I get access denied : javascript:( function() { location.href = 'https://john:pwd@api.del.icio.us/v1/posts/add?url=' + encodeURIComponent(window.location.href) + '&description=' + encodeURIComponent(document.title) + '&tags=testtag'; } )() Is this possible via a javascript bookmark?

store data for bookmarklet

时光总嘲笑我的痴心妄想 提交于 2019-12-04 09:11:13
I am making a bookmarklet, which calls a Google App Engine app. The GAE app uses login information, which I want to store in bookmarklet, so when user first clicks bookmarklet,it asks for login info, but from next time onwards it automatically supplies it. The difficulty of a bookmarklet directly storing data is that it can only store data in cookie or in localStore, both of which "belong" to whatever page it is currently on. That means it won't work again the next time you use it on a different page, and it also means the page you are on can access the data, which is generally very bad for

How to detach event in IE 6 7 8 9 using JavaScript

房东的猫 提交于 2019-12-04 07:28:31
This is a partial code, not the full version. I have a highlighter that highlights a specific html element when the mouse hovers . I also have a click event and listener . My problem is : the highlighter event/listener does not detach when using Internet Explorer v6 v7 v8 v9 What am i doing wrong? this is how i attach the event and start the event listener: if (document.body.addEventListener) { //alert(11); document.body.addEventListener('mousemove', handler, false); } else if (document.body.attachEvent) { //alert(12); var ff=function(e) { return handler(e || window.event); }; //alert(ff);