javascript

Execute Javascript When Page Has Fully Loaded

I need to execute some javascript when the page has fully loaded. This includes things like images. I know you can check if the DOM is ready, but I didn't know if this is the same as when the page is fully loaded. ...

Is there a way of writing PDF byte data to an IFrame clientside

Odd question I know but say one has PDF byte data contained within a hidden field on a page which also has an IFrame on it. Is there a way of writing the pdf data to the IFrame using JavaScript such that the IFrame will load in the adobe plug-in and display the data? The reason we'd like to do this is that we need the PDF data in the h...

Are Javascript/Cookies enabled or disabled?

I am looking for some code that will return me values if the user has JavaScript enabled or disabled, as well as cookies. I know this is probably easy to do, but my time constraints are so tight, it hurts. There has to be something out there using php that does this. Ideally I would love to find code that has a page setup with all the...

Possible to replicate jQuery's separation of JS events from inline attributes in ASP.NET AJAX?

Can something like this, borrowed from jQuery, be done without jQuery and with ASP.NET AJAX only? <a href="nojslink.html" class="clickMe">Click Me</a> And then in an external JS file: $('a.clickMe').click(function(){ alert('Thanks for clicking'); }); ...

How to delay a function from returning until after clicks have occurred

The following confirmDialog function is called midway through another jquery function. When this confirmDialog returns true the other function is supposed to continue... but it doesn't. The reason for this seems to be that the entire confirmDialog function has already executed (returning false) by the time the continue button gets clicke...

Debugging autoproxy (PAC) javascript with alert()?

I am writing a custom .pac script for use with Firefox. Following numerous examples I've seen, I intersperse alert()s in order to debug it, but no alerts popup, even though the script is clearly being invoked. (I am clicking "Reload" in the "Connection settings" after each change to my script. I have even tried restarting Firefox.) Are ...

What regular expression would match this data?

I have the following within an XHTML document: <script type="text/javascript" id="JSBALLOONS"> function() { this.init = function() { this.wAPI = new widgetAPI('__BALLOONS__'); this.getRssFeed(); }; } </script> I'm trying to select everything in between the two script tags. The id will al...

Anyone know a YUI-based Image Magnifier?

Does anyone know of a YUI-based image magnifier? I'm looking for something similar to the JQuery "JQZoom" plugin. Mousing over the image displays the matching portion of the enlarged version in a separate panel. ...

Set default value for Search field - Please Help!

Hi, I'm trying to set a default value for a search field. The idea is that the Search-Field has the value "Search" until the user clicks into it, then it should be empty. Also as long as it is "blank" (with "Search" as the value) it should have the class ".blank". I tried this <input autocomplete="off" class="" id="searchq" name="sea...

Stop Anyone From Viewing My Site Using an IFrame

I have looked and tried but don't see where I can stop some being able to browse my site through an IFrame or Thickbox? I want to stop banned members from accessing the site through proxy sites that give the end user the ability to browse through a IFrame. I know nothing may be full proof but it's still worth the question. ...

Get current URL with javascript?

This seems like a rather simple request but no amount of Googling has turned up a satisfactory answer, which is surprising because all I want is to get the website URL. Not the URL as taken from a link (I can already do that just fine) on the page loading I need to be able to grab the full, current URL of the website and set it as a vari...

Creating SVG graphics using javascript?

How can I create SVG graphics using Javascript? Do all browsers support SVG? ...

Embedding web controls across sites - using IFrames/Javascript

Hi I'm just looking for clarification on this. Say I have a small web form, a 'widget' if you will, that gets data, does some client side verification on it or other AJAX-y nonsense, and on clicking a button would direct to another page. If I wanted this to be an 'embeddable' component, so other people could stick this on their sites,...

Turn String array values into array object

I am passing a string into a hidden field on the page and then splitting it in order to try to get an array of items I can iterate over and add multiple markers onto a google map. If I hard code the array it works fine, but if I try to split the string and use the same code it does not work. I'm assuming because splitting the string cr...

JQuery - Write to opener window

Hello, I have an HTML page that opens another page via JavaScript. When a user clicks a button in the other page, I want to post a message in a DIV of the opening page via JQuery. I cannot put my finger on it, but I cannot seem to get this to work. Here is my opener page <html> <head> <script type="text/javascript" src="jquery-1...

Can I customize cloning in Script.aculo.us's ghosting?

I have a Draggable in Script.aculo.us. I'd like to use ghosting, which clones the dragged element, so you appear to be dragging a "ghost" of the element. However, this element contains an iframe. When I begin the drag, the clone's iframe loads, which is annoying. I'd like a chance to remove the iframe from the clone. How can I do th...

how do i write a javascript alert box to give a yes or no question and integrate with php calls?

i am trying to figure out how to create a javascript alert box asking the user if they would like to delete a record (that their viewing) and when the user presses yes a query is called through php to delete a database row. and if the user presses no nothing will happend. wondering how this can be done thanks ps: this is what i did a...

how do i write a javascript alert box to give a yes or no question and integrate with php calls? (repost)

i'm reposting this post i just posted a while ago. http://stackoverflow.com/questions/1035266/how-do-i-write-a-javascript-alert-box-to-give-a-yes-or-no-question-and-integrate/1035285#1035285 i wasnt getting anymore responses so i figured the post got lost in somewhere out there. what i tried doing was this <script type="text/javascript...

What JavaScript object copy function works with greasemonkey?

I know there is another question related to copying objects in JavaScript here, but the code they provide does not work with greasemonkey. From what I was able to trace, the code for the accepted answer dies/ stops at the line : var temp = new obj.constructor(); Is there any way to see what went wrong ? It's not really necessary I use...

Firefox Error: Permission Denied to get Window.Document

I have a standard 3-frame layout; "fnav" on the left, "fheader" at the top and "fcontent" below the header. All files are located locally on the hard drive. This is the JS function that is throwing the error: function writeHeaderFrame() { try { var headerFrame = window.top.frames['fheader']; var headerTable = docu...