javascript

Google Maps: Dynamically resize infowindow

How do I resize the info window once it's opened? I have a hyperlink inside the window which generates an AJAX-request; on the callback I would like to resize the info window. ...

jQuery event to trigger action when a div is made visible

I'm using jQuery in my site and I would like to trigger certain actions when a certain div is made visible. Is it possible to attach some sort of "isvisible" event handler to arbitrary divs and have certain code run when they the div is made visible? I would like something like the following pseudocode: $(function() { $('#contentDiv...

Telling when an iframe is on a new URL

Hi, I am using JavaScript to make a small iframe application, and I cannot seem to figure out a way to update the URL in my URL bar I made when someone clicks a link inside the iframe. It needs to be instantaneous, and preferably without checking every millisecond whether or not the value of document.getElementById('idofiframe').src ha...

why do I get 24 when adding 2 + 4 in javascript

I am trying this: function add_things() { var first = '2'; var second = '4'; alert(first + second); } But it gives me 24 instead of 6, what am I doing wrong? ...

Force any HREF in an IFrame to use its parent as the target

I'm currently using an IFrame to sandbox user generated content on a website. This eliminates any styling issues with our main stylesheets. However, when a user generates a link using our rich text editor, we would like the link to open in the parent and not just open the link in the IFrame. I realize you can set a target to the paren...

Yet Another world city auto complete field question

Hi, I know that this question has maybe been asked several times but I have search several days without getting any satisfying answer. Some sites, like eventful.com, etc. have a autosuggest city field with cities from around the world (even small cities in small countries from Tunisia). I'm wondering how they achieve it. I've a text l...

JavaScript to reload the page as GET request

I have a seemingly simple question, but can't find the answer. I have a webpage, which may have resulted from a POST request and may have an anchor (#) in the URL. I want to reload this page as a GET request in JavaScript. So it's similar to this question, but I actually want to avoid the POST, not just the warning about it. So, for exa...

document.setAttribute

Can this be used to change CSS? Cant see much on w3 about it. Anyone know anything about it. If this forum/site isnt the place for asking browser standard questions, can someone point me in the right direction? Thanks --Mark ...

stopPropagation not working for KeyListener in YUI 2.7

I have created a new YAHOO.util.KeyListener to attach to a specific element and have also created another new YAHOO.util.KeyListener to attach to the entire document. They are both associated with the "enter" key (keys:13). In the handler function for the listener attached to the specific element, I have the following code: ...

How to call a function belonging to another object in JavaScript (using script.aculo.us)

Hi- I'm creating a new instance of the 'Draggable' object (from the script.aculo.us dragdrop module) inside a function belonging to an object I created. Let's call that object the 'Person' object. Easy enough. However, from inside the 'onEnd' function within the Draggable object, I need to call another function, getCell(), also belongi...

Facebook subdomain issue

Hello, I'm having problems getting fb connect working on subdomains. the connect button comes up fine, but after it authenicates, the popup just goes blank and no action happens after that. I set the base domain for the app that facebook required for subdomains to work. Error Info: For this example look at test.edited.com I get the ...

JQuery, how to find list of div's with similar ID

Hello everybody. I have a structure of html like this: <div id="triger1">some elements inside</div> <div id="triger2">some elements inside</div> <div id="triger3">some elements inside</div> <div id="triger4">some elements inside</div> How do I get array of all the div's in JQuery with the triger ID in them (as you can see, they all h...

How to return AJAX response Text?

I use prototype to do my AJAX development, and I use the code like this: somefunction: function(){ var result = ""; myAjax = new Ajax.Request(postUrl, { method: 'post', postBody: postData, contentType: 'application/x-www-form-urlencoded', onComplete: function(transport){ if (200 == tra...

Non GPL alternative to JQuery's pngfix plugin

Like the question says the pngfix jquery plugin is GPL'd. I'd like to use it in a commercial way without having to comply with the GPL. Being that there is no way to do so, I was wondering if there is another alternative to this library that I could use? The plugin found here does seem to have limitations that affect my usage. ...

Encoding apostrophe

i am building up a string on the server that is getting put into a javascript variable on the client. what is the best of encoding this to avoid any issues right now on the server i am doing something like this: html = html.Replace("'", "&#39;"); but i assume there is a more elegant fool proof way of doing stuff like this. ...

Javascript - programmatically invoking events

Say I add events to an object using either addEventListener or attachEvent (depending on the browser); is it possible to later invoke those events programmatically? The events handlers are added/removed using an object like this: var Event = { add: function(obj,type,fn) { if (obj.attachEvent) { obj.attachEvent('on'+type...

replace function in jquery

I am using following code $.post("insertPrivateMessage?action=sendchat", { to: GroupUserArray[count], message: message, username: $("#author").val(), GROUP: chatboxtitle } , function(data){ message = message.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\"/g,"&quot;"); }); but when replacin...

Accessing GPS on Blackberry using Javascript and sending lat/long values to a server via url

When you obtain the lat/long values from a GPS enabled blackberry device, how do you send those values to a server via a url? By the way, I'm trying to do this in Javascript. "window.location.href=..." works fine on the iphone. I was thinking something like this would work but it doesn't seem to: function locationCB() { ...

Javascript variable in quotes

hai I want to give a javascript variable within a double Quotes , Can any one help me? ...

jquery clone drag

Hi all, i m having a problem in appending a tag over an area. I am tring to append the clone of #Normal_Tag1_div to #droppable after changing the id. I also want to make that clone draggable over #droppable only . How can i do that?? $('#Normal_Tag1_div').draggable({helper:'clone'}); $('#droppable').droppable({ dro...