Dictionary Bookmarklet To Open In New Window

Aug 6, 2010

How could I make this useful dictionary bookmarklet open in a new window?

javascript:var%20t=((window.getSelection&&window.getSelection())||(document.getSelection&&document.getSelection())||(document.selection&&document.selection.createRange&&document.selection.createRange().text));var%20e=(document.charset||document.characterSet);if(t!=''){ location.href='http://translate.google.com/translate_t?text='+t+'&hl=en&langpair=auto|en&tbb=1&ie='+e;}else{location.href='http://translate.google.com/translate?u='+escape(location.href)+'&hl=en&langpair=auto|en&tbb=1&ie='+e;};

Its the "To English" bookmarklet as featured on lifehacker (http://lifehacker.com/5168984/to-english-bookmarklet-quickly-easily-translates-any-text-with-one-click).

View 1 Replies


ADVERTISEMENT

Open Bookmarklet In New Window?

Oct 6, 2010

I found this bookmarklet which I'm using in Firefox Would anyone here be willing to modify it to display its results in a new tab, instead of using the current tab?

Code:
javascript:q = "" + (window.getSelection ? window.getSelection() : document.getSelection ? document.getSelection() : document.selection.createRange().text); if (!q) q = prompt("You didn't select any text. Enter a search phrase:", ""); if (q!=null) location=("http://www.google.com/search?num=100&q=site:" + escape(location.hostname) + " "" + escape(q.replace(/"/g,"")) + """).replace(/ /g, "+"); void 0

View 1 Replies View Related

Make Bookmarklet Open In New Window?

May 21, 2009

I need this bookmarklet (below) to open in a new window and display the info there. It needs to work in both FF and IE. It would be in one line in the bookmarklet but I expanded it for readability. It should work against our site: [URL]

[Code]...

View 2 Replies View Related

Bookmarklet Parse URL - Take The Current URL Of The Page And Open A New Window With A URL Based On The Current Page?

Mar 16, 2009

I'm trying to create two bookmarklets:

1. Take the current URL of the page and open a new window with a URL based on the current page. Some examples (I use "->" to mean "this URL turns into that URL"):I plan to use these bookmarklets in sequence, first pressing 1 to log into the CMS, then pressing 2 to edit the current page.

View 5 Replies View Related

JS Bookmarklet Opens New Window Instead Of Working In The Current One

Jul 28, 2011

I have found a script for opening all linked images of one page in a new window and displaying all images in full size inline. It works so far, however:

I want the images to be displays in the current window i am in instead of opening a new window.

Here is the code:

Code:
javascript:(function(){function%20I(u){var%20t=u.split('.'),e=t[t.length-1].toLowerCase();return%20{gif:1,jpg:1,jpeg:1,png:1,mng:1}[e]}function%20hE(s){return%20s.replace(/&/g,'&').replace(/>/g,'>').replace(/</g,'<').replace(/"

[Code]....

View 3 Replies View Related

IE7 Access Denied On Window.document.write() From Bookmarklet

Feb 9, 2009

I am trying to write a bookmarklet that will let me know an object.For the most part, it works as best I could hope until I try it on a real page.For the purposes of understanding, I am using the Bookmarklet builder here [URL] for testing.

Here is the code:

(function (){
var theObjStr = prompt('What Object would you like to know?','');
var theObj = eval(theObjStr);

[code]....

I compress the code, and test it via the link on the bottom of the page and everything works magically.Add the Bookmarklet to your favorites, and go to [URL] and try to run it in IE7.I am getting an access denied error when the code gets to the line:

var wHndDoc = jjPopWin.document; I have tried everything including just calling a straight
jjPopWin.document.write();
with the same results.

I am on Windows XP SP3, Using IE7 (works great in Firefox 2 &3).

View 5 Replies View Related

Bookmarklet "Firefox Notepad" - Edit To Open A Text File?

May 8, 2010

This is a simple bookmarklet "Firefox Notepad" source @here:

[Code]...

View 2 Replies View Related

Code - Void Window.open - Link Would Open In The Same Window?

Feb 7, 2009

I have this piece of code which is opening link in new window:

How to change this code so link would open in the same window?

Probably I should change this part: javascript:void window.open

View 1 Replies View Related

Links That Uses Window.open Then Open A New Designated Window

Jan 17, 2012

I have a problem on the links on my page im working.sorry guys still a noob and my english is not that good. :b. my question is like i have a list of packages of food. [link_a] [link_b] [link_c] and i have a function that i put in my head tag:

function linkA()
{
window.open('link_a.html','link','width=300,height=200,resizable=yes');
}

now i can go to linka.html by click my link <A HREF="javascript:linkA()" >link a</A> is there a way i can have one functions that can open a link depend on what page .when it clicks then go to its designated page or i have to stick on writing function for linkB ,C,D and so on.

View 7 Replies View Related

Open A Link On The Same Window Using Window.open Or Any Other Method?

Oct 19, 2011

How to open a link on the same window using window.open or any other method in JavaScript.

View 2 Replies View Related

Child Window Close Event - Opening Another Link In A Separate Window Using Window.open()

Jan 29, 2010

I have a HTML and I am opening another link in a separate window using window.open() . The child window is something like 'http://yahoo.com' which is out side html. I need to refresh the parent window when the child window is closed.

View 4 Replies View Related

Open In New Browser Window (like With Target="_blank", Not Window.open)

Dec 1, 2011

Code: window.location but have it open in new browser window (like with target="_blank", not window.open)

View 7 Replies View Related

Thru Window.open Open A Word Document In Print Preview Mode

Jul 23, 2005

Through window.open or window.showmodaldialog, I want to open a word
or excel document in Print Preview mode. Bcos I don't want the user to
make any changes or save it but the user can ONLY VIEW OR take a print
out.

View 1 Replies View Related

Window.Open In FireFox - Click Very Quickly - Multiple Windows Open

Nov 16, 2009

I'm using an <A> tag with an onclick event to open a window with JS (window.open)... In FIREFOX, if I click very quickly, multiple windows open. Not a problem in IE.

View 8 Replies View Related

Window.open - How To Open A Local File (xml) With Firefox

Apr 2, 2008

my file is located at c:AdminFiles.xml

i tried the following ways

window.open("c:/AdminFiles.xml",'HeavyXml');
window.open("c:AdminFiles.xml",'HeavyXml');
window.open("c:\AdminFiles.xml",'HeavyXml');

in the above i'm getting the following error: "Firefox doesn't know how to open this address, because the protocol (c) isnt associated with any program"

window.open("file:///c:\AdminFiles.xml",'HeavyXml');

the last attempt give to respond at all...

View 5 Replies View Related

Dictionary Class

Sep 18, 2002

here's something like an associative array implementation...

/*
File: Dictionary.js
Version: 1.0
Last modified: 09.17.2002
Author: Alexandar Minkovsky (a_minkovsky@hotmail.com ; URL: http://www24.brinkster.com/alekz)
Copyright: Left
Type: Class
Exports: Dictionary class.
Dependencies: None.
Description:
Similar to ASP "Scripting.Dictionary" Object, or an associative array
with somewhat limited functionality. There's a few differences:
- "item" property is replaced by two methods getVal and setVal.
- "key" property is replaced by the setKey method.
As the value of an item can be virtually anything, even another Dictionary object,
the Dictionary Class might be usefull.
If someone have a suggestion or wants the Dictionary class to be extended some way,
feel free to drop me an e-mail.
Tested with: IE4; IE5; IE5.5; IE6; NS4.78; NS6.0; NS6.1; NS6.2; NS7.0; Mozilla 1.0; Mozilla 1.1; Opera 6.0
*/
/*
================
Dictionary Class
================
- Instanciating
oDict = new Dictionary();

- Properties
~ Public
(int) count - Number of keys in the Dictionary. Default: 0. Read only, do never manually set this property!
~ Private
(Object) Obj - the object actually containing the data. Do never use it directly.

- Methods - look at the function descriptions for detailed explanation.
~ Public
(BOOL) exists(sKey)
(BOOL) add (sKey,aVal)
(BOOL) remove(sKey)
(void) removeAll()
(Array) values()
(Array) keys()
(Array) items()
(Any) getVal(sKey)
(void) setVal(sKey,aVal)
(void) setKey(sKey,sNewKey)
*/
//****************************************
//Dictionary Object
//****************************************
/*
function: Dictionary
Parameters: None
Returns: A new Dictionary object.
Actions: Constructor.
*/
function Dictionary(){
//Properties
//~Public
this.count = 0;
//~Private
this.Obj = new Object();
//Methods
//~Public
this.exists = Dictionary_exists;
this.add = Dictionary_add;
this.remove = Dictionary_remove;
this.removeAll = Dictionary_removeAll;
this.values = Dictionary_values;
this.keys = Dictionary_keys;
this.items = Dictionary_items;
this.getVal = Dictionary_getVal;
this.setVal = Dictionary_setVal;
this.setKey = Dictionary_setKey;
}
//****************************************
//Method implementations
//****************************************
/*
function: Dictionary_exists
implements: Dictionary.exists
Parameters:
(String) sKey - Key name being looked for.
Returns: (BOOL) - true if sKey is found ; false if it is not.
Actions: Iterates through all Dictionary keys and checks for sKey.
*/
function Dictionary_exists(sKey){
return (this.Obj[sKey])?true:false;
}
//****************************************
/*
function: Dictionary_add
implements: Dictionary.add
Parameters:
(String) sKey - Key name to be added.
(Any) aVal - Value to be associated with sKey.
Returns: (BOOL) - true if sKey is created ; false if it is not (because of a duplicate Key name).
Actions: Adds a new Key=Value pair to the Dictionary.
*/
function Dictionary_add(sKey,aVal){
var K = String(sKey);
if(this.exists(K)) return false;
this.Obj[K] = aVal;
this.count++;
return true;
}
//****************************************
/*
function Dictionary_remove
implements: Dictionary.remove
Parameters:
(String) sKey - Key to be removed.
Returns: (BOOL) - true if sKey has been removed ; false if it has not (did not exist).
Actions: Removes a specified key from the Dictionary.
*/
function Dictionary_remove(sKey){
var K = String(sKey);
if(!this.exists(K)) return false;
delete this.Obj[K];
this.count--;
return true;
}
//****************************************
/*
function: Dictionary_removeAll
implements: Dictionary.removeAll
Parameters: None
Returns: Nothing
Actions: Removes all key=value pairs from a Dictionary object.
*/
function Dictionary_removeAll(){
for(var key in this.Obj) delete this.Obj[key];
this.count = 0;
}
//****************************************
/*
function: Dictionary_values
implements: Dictionary.values
Parameters: None
Returns: Returns an Array containing all the item values in a Dictionary object.
Actions: Iterates through the Dictionary name=value pairs and builds an Array of all values.
*/
function Dictionary_values(){
var Arr = new Array();
for(var key in this.Obj) Arr[Arr.length] = this.Obj[key];
return Arr;
}
//****************************************
/*
function: Dictionary_keys
implements: Dictionary.keys
Parameters: None
Returns: Returns an Array containing all existing keys in a Dictionary object.
Actions: Iterates through the Dictionary name=value pairs and builds an Array of all keys.
*/
function Dictionary_keys(){
var Arr = new Array();
for(var key in this.Obj) Arr[Arr.length] = key;
return Arr;
}
//****************************************
/*
function: Dictionary_items
implements: Dictionary.items
Parameters: None
Returns: Returns a bidimensional Array containing all existing keys=value pairs in a Dictionary object.
Actions:
- Iterates through the Dictionary key=value pairs and builds a bidimensional Array.
- First index contains the key name ; second index contains the value:
ex. Arr[0][0] is the key name of the first Dictionary item
Arr[0][1] is the value of the first Dictionary item
*/
function Dictionary_items(){
var Arr = new Array();
for(var key in this.Obj){
var A = new Array(key,this.Obj[key]);
Arr[Arr.length] = A;
}
return Arr;
}
//****************************************
/*
function: Dictionary_getVal
implements: Dictionary.getVal
Parameters:
(String) sKey
Returns: Item value for the passed sKey.
Actions: Retrieves the Dictionary item value corresponding to sKey.
*/
function Dictionary_getVal(sKey){
var K = String(sKey);
return this.Obj[K];
}
//****************************************
/*
function: Dictionary_setVal
implements: Dictionary.setVal
Parameters:
(String) sKey
(Any) aVal
Returns: Nothing.
Actions:
- Sets the Dictionary item value corresponding to sKey to aVal.
- If The key is not found in the dictionary it is created.
*/
function Dictionary_setVal(sKey,aVal){
var K = String(sKey);
if(this.exists(K))
this.Obj[K] = aVal;
else
this.add(K,aVal);
}
//****************************************
/*
function: Dictionary_setKey
implements: Dictionary.setKey
Parameters:
(String) sKey
(String) sNewKey
Returns: Nothing.
Actions:
- Changes sKey to sNewKey
- if sKey is not found, creates a new item with key=sNewKey and value=null
- if sKey is not found, but sNewKey is found - does nothing.
- if sKey and sNewKey both exist - does nothing.
*/
function Dictionary_setKey(sKey,sNewKey){
var K = String(sKey);
var Nk = String(sNewKey);
if(this.exists(K)){
if(!this.exists(Nk)){
this.add(Nk,this.getVal(K));
this.remove(K);
}
}
else if(!this.exists(Nk)) this.add(Nk,null);
}
//****************************************

View 2 Replies View Related

Portable Dictionary Class

Aug 23, 2007

Can you show me an example of a working dictionary object that is
portable? I would like to have something like:

d = new PortableDict()

d.setValue('a',12)
d.setValue('b',-3)

subd = new PortableDict()
d.setValue(subd,51)

d.hasKey('a') // true
d.hasKey('c') // false
d.hasKey(subd) // true
d.getValue('a') // 12

etc.

Alternatively, is there a programming scheme that allows me to assign
custom properties/attributes to DOM elements? I can do it with
FireFox, but not with IE - it throws an error telling that the given
attribute is not supported. Which is strange because AFAIK in
JavaScript you can freely modify objects, add attributes and methods
on the fly. But it looks like that in IE, HTML DOM elements are not
real JavaScript objects.

View 8 Replies View Related

Window.open() Doesn't Open New Window In FF, Only New Tab

Feb 14, 2011

window.open() doesn't open an entirely new window in FF3.6, just a new tab

Edit: Yeah, ok, so if i specify a size smaller than the current standard window, it'll be forced to open a new window. but what if i want a new standard sized window to open entirely?

View 4 Replies View Related

Can Javascript Add Items To ASP/VBScript Dictionary Object?

Jul 23, 2005

I got two ASP pages. One is ASP email form (I'm using Persist ASP
Email component). Another one has all file links in it. For example,
when user click Outlook course hyperlink. It will pop up another
window with outlook course PDF file. (All PDF files are already in the
server).

What I am trying to do is: When user click the "Add Email" hyperlink,
it will add that course name and filepath into ASP/VBScript Dictioanry
Object. After the user finish and click "Attach to email" button. All
the files will be attached in the email as an attachment.

Because I am not familar with VBScript. So, can Javascript add items
to ASP Dictionary Object?

View 3 Replies View Related

Double-click Online Dictionary Definition Script?

Sep 3, 2009

I've always wanted to help second-language English speakers access my site better, by offering a 'double-click on a word' definition in other languages. I had a useful script for some years which was rather dated, and ceased to work if there was an iframe on the page for some reason. Anyway, I found a very good solution at [URL]However, this opens the definition in a new tab/window.

Having experimented with it opening in a popup, I found problems in getting the popup to regain focus if someone had not closed it before looking for another definition. And anyway, popups can get blocked. So I found a nice layer/iframe solution at [URL] though their positioning of the layer is poor, at least in FF because it slides too far down below the bottom of the page. Their script is: [URL]I have modified that to work with dictionarist and stripped out their own floating part of the script, so that it works with position fixed for everything except IE6. But for IE6, I need to still change this from position fixed to position absolute, and then use a script to float the box.I have been trying the script I use successfully elsewhere in a vaguely similar context:

Code:

/* Script by: www.jtricks.com
* Version: 20060303
* Latest version:

[code]....

which has a call to startFloat(); near the end, which is based on their own floating script nearer the top of [URL] which I have removed. (Doubtless the references to Netscape (RIP) can be removed.)

View 4 Replies View Related

Dictionary Page - Display Definition Of Word OnClick

Oct 9, 2009

I am doing a distionary page with javascript and I am trying to get it so that the definitions come up when the word they are for is clicked on.

Here is my javascript
Javascript Document
var filename = "dictionary.js";
function loaded(which){
alert(which + " loaded");
}/**/
function showInfo(which){
var placeholder = document.getElementById("definition");
var source = whichInfo.getAttribute("href");
placeholder.setAttribute(source);
alert("showInfo called");
return false;
}function prepareList(){
if (!document.getElementsByTagName || !document.getElementById)
return false;
var words = document.getElementById("words");
if (!words) return false;
var links = words.getElementsByTagName("a");
for(var i = 0; i < links.length; i++) {
links[i].onclick = function(){
showInfo(this);
return false;
}}
alert("prepare list done");
}function init(){
prepareList();
}loaded(filename);
window.onload = init;

Here is my html
<!DOCTYPE html PUBLIC "-W3CDTD XHTML 1.0 StrictEN" "[URL]">
<html xmlns="[URL]">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Dictionary DOM Scripting</title>
<link href="../styles/main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="dictionaryScripts/dictionary.js"> </script>
</head><body>
<div class="page">
<div class="nav"><ul>
<li><a href="../home.html">Home</a></li>
<li><a href="../form/form.html">Form</a></li>
<li><a href="dictionaryCSS.html">Dictionary with CSS</a></li>
<li><a href="dictionaryDOM.html">Dictionary with DOM scripting</a></li>
<li><a href="discussionPage.html">Discussion</a></li>
</ul></div><div class="header">
<h1>Dictionary with DOM Scripting</h1></div>
<div class="mainContent">
<div id="words"><h2>L</h2>
<p>Click on the word to get a definition</p>
<dt><a href="lecturer.html">LECTURER, n.</a></dt>
<dt><a href="learning.html">LEARNING, n</a></dt>
<dt><a href="liar.html">LIAR, n.</a></dt>
<dt><a href="love.html">LOVE, n.</a></dt></div>
<div id="definition">Choose a definition</div>
</div></div></body></html>

View 5 Replies View Related

Script To Close Old Window And Open New Window With New Link And Specific Size

Jan 29, 2006

I need a script that will open a new window (popup / new link) in a specific size, but will also close the old window (where the popup came from). I know the popup window is easy but finding a work-able close window script as the new window is opened is impossible!!

View 3 Replies View Related

Child Pop Up Race Condition Using Window.open Need To Detect Window.onload

Nov 22, 2011

I am trying to pop up a window and then do stuff(set flags) when the content of the new window is done loading. For this I am trying to detect the window.onload of the pop-up child window but so far I am unsuccessful. I believe my problem is that the URL of child window is on different domain, than the one of the opener(parent) so that the window.onload is not being called. Though this may change, at the moment I do not have access to the code for the page I'm opening up in the pop-up. Im pretty new to web development.

[Code]....

View 3 Replies View Related

Open A Popup Window From A PHP Site And Pass In Some Parameters To Use In The Pop Up Window

Sep 23, 2010

I need to open a popup window from a PHP site and pass in some parameters to use in the pop up window. I have the params in an input box and need to get the val of the box into a param and pass it to the new popup window. All pages are local and in the same folder. The id of the input box is 'ddutykey'. The name of the new window would be showduty.php if possible.

View 3 Replies View Related

Can't Open Address Bar With Window.open

Jul 23, 2005

With ref. to MS IE, when I use window.open with the usual sizing and
'toolbar=yes', 'menubar=yes' the target URL opens in a new window -
but without an address bar.

'addressbar=yes' does not seem valid. Can someone please tell me how
to proceed?

View 3 Replies View Related

Window.open - Cannot Open With Scrollbars

Oct 13, 2005

When creating a new window and specifying ANY features (on or off) at all like such:

<A HREF="javascript:void(0)"
onclick="window.open('NONE.php','welcome','toolbar=1,location=1,directories=1,status=1,menubar=1,resizable=1, scollbars=1')">
Open a new window</A> the new window does not have scrollbars even though scrollbars are necessary for my document (vertically, at least).

This problem occurs in Firefox and Internet Explorer 6. The problem does NOT occur if there are no features are specified.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved