javascript

Hide refinement tabs in Google CSE?

Is there a way to hide the refinement tab(s) in a Google Custom Search (CSE)? I'm using the Ajax CSE and I don't want/have refinements. Therefore a single tab is pretty useless and disturbing. ...

how to clear file input with javascript?

I want to clear the file input in my form. I know about setting the sources to the same method... But that method wont erase the selected file path. Is there a way to clear the path inside the file input? NOTE: I dont want to reload the page, or reset the form... NO AJAX... So, impossible? Thanks ...

What does this code (from a Mozilla Add-on tutorial) do?

var Helloworld = { onLoad: function() { // initialization code this.initialized = true; }, onMenuItemCommand: function() { window.open("chrome://helloworld/content/hello.xul", "", "chrome"); } }; window.addEventListener("load", function(e) { Helloworld.onLoad(e); }, false); http://kb.mozillazine.org/Getting%5Fstar...

Using greasemonkey and/or gmail API to reduce width of mail pane.

Hi there. I'm on my way to creating a greasemonkey script for gmail. The first thing I want to play with is reducing the size of 'main' pane. This is where either the list of emails are or where the email message is being displayed. Using Firebug, I can find two separate instances of a "<div class="nH nn" style="width: 1013px;">" tag....

Splitting a Quoted Search String with Regular Expressions

I'm trying to figure out how to split a string into searchable terms. I need it to split on spaces and single quotes (ignoring single character, non-quoted results) return quoted phrases without the quotes So if I'm applying it to: "quoted phrase" single words It would return quoted phrase single words Here's what I have so far...

CSS Menu hides behind flash only in IE (SWFObject)

I know that this question is asked a lot, I checked all of the "related questions" before posting this and I tried all of the different solutions I could find, but to no avail. I am working on a site at Site Page and there is a header navigation using Pop Menu Magic which the original creator used, it currently is hiding under the swf t...

How do I strip white space when grabbing a text()

Hi, I have the following jquery statement. I wish to remove the whitespace as shown below. So if I have a word like: For example "#wordOperating System/test" I would like the end result to show me "#wordOperatingSystemtest". (ie without slash and space). The slash works fine but I can't get the space to be removed. Please help! ...

Encoding of window.location.hash

Does window.location.hash contain the encoded or decoded representation of the url part? When I open the same url (http://localhost/something/#%C3%BC where %C3%BCtranslates to ü) in Firefox 3.5 and Internet Explorer 8, I get different values for document.location.hash: IE8: #%C3%BC FF3.5: #ü Is there a way to get one variant in both...

Where do I put javascript when using an asp.net user control?

I have a user control with a "More Info" link. When clicking that link, I want a div to appear which gives the user more information. Where do I put the javascript? It doesn't appear to work when placing at the top of my user control. How do you handle javascript and jquery when you are using a user control? I have jquery included i...

Can someone explain javascript prototypal inheritance

Hi all, I wonder if someone could be kind enough to explain the function.prototype thingie (thingie!!??) in OO javascript. I come from a server side programming background, and may be I am not grasping the whole concept of prototypes, Given the following snippets of code: var animate=function(){}; animate.angular=function(){/*does som...

Are these jQuery expressions equivalent?

I'm wondering if these two expressions are equivalent, because if they are, it would make this much easier. $('div', this).filter(':not(.trigger)')... $('div:not([class*=trigger])', this)... (this providing a context under which to look for the specified div) ...

Integration of hosted site with external features

I have a hosted Q&A site that I'm looking to augment with additional features not provided by the host. I'm comfortable implementing the server-side features (they should take me around 6-8 weeks), but I'm not able to modify the Javascript that handles the posting of questions/answers. I'm puzzling over how to add extra scripts that can...

how do I extract content from source genarated by javascript .?

Hello I need to extract content generated with javascript from a site , I cannot extract the data considering the source because always show the content look like : the content generated with those java1.js and java2.js so I need to extract the html source generated with this js scripts I can extract the content manully using fi...

Detect when user has selected a file for upload (without timers)

Hi, I would like to to create a 2-step file uploader: Open dialog. Select one file from computer. I would like to eliminate the step where the user must submit the form, and instead do it automatically with JavaScript. Is there anyway to achieve it? Thanks. ...

Commenting JavaScript functions á la Python Docstrings

It is valid JavaScript to write something like this: function example(x) { "Here is a short doc what I do."; // code of the function } The string actually does nothing. Is there any reason, why one shouldn't comment his/her functions in JavaScript in this way? Two points I could think of during wiriting the question: The st...

Dynamically added JavaScript not finding dynamically added fields in IE

Hi, I have a table which has a button to "Add Rows". This button adds a row dynamically with JQuery. It works by copying the first ... and then replacing all the id=".." with an incremented number. The problem is that the rows have a YUI AutoComplete which looks like the following: <td> <input type="hidden" name="location_num[0]" ...

Need to use body onload event, but third party JavaScript library has hijacked it.

I'm using Simile to draw dynamic timelines. I am also using an in-house library to add a comment blog. Our in-house library uses the body element's onload event to initialize. <body onload="initComments('myID')"> But Simile seems to have hijacked the onload for their own purpose so that initComments('myID') never executes. Short of...

Find value in Json by javascript

Hi All, I cant find one way to get this value ("comment") into json using javascript. var myJSONObject = { "topicos": [{ "comment": { "commentable_type": "Topico", "updated_at": "2009-06-21T18:30:31Z", "body": "Claro, Fernando! Eu acho isso um extremo desrespeito. Com os celulares de ho...

Using ExternalInterface.addCallback in AIR

We're building an Ajax AIR app but want to include a Flex component in it to display photos. Currently using Doug McCune's 'coverflow' but also looking at Sebastiaan Holtrop's 'sebCoverflow'. We're trying to communicate between JS and the Flex component but can only do this one-way (AS->JS) using ExternalInterface.call(). ExternalInte...

Loading executable code through <img> or <a> tags?

I'm working on an app that would allow people to enter arbitrary URL's that would be included in <a href="ARBITRARY URL"> and <img src="ARBITRARY URL" /> tags. What type of security risks am I looking at? The app is coded in PHP, and the only security countermeasure I currently perform is using PHP's htmlentities() function against the...