javascript

Accessing functions in a swf-file through javascript [chatroulette.com]

Lately I have been interested in the code behind chatroulette.com. As you probably know it is a peer-to-peer webcam-chat-service written in actionscript, as I understand. What i have been wondering about is weather its possible to extract the ip-address of whomever you are currently communicating with. I have seen services that do that, ...

JQuery's Contains returns an Object?

Hello all, I am trying to see if a particular string appears in a div. I have tried but it doesn't return true or false which is what I thought contains did? if($("#path"+i+"_status:contains('!=')")){ alert($("#path"+i+"_status:contains('!=')")); //alerts - [object object] return true; } Here is my HTML: <div class...

Convert an XML Schema date string to a Javascript Date

I couldn't find a good implementation of this on the internet, so I wrote one. Here's hoping this page becomes the first hit in Google. Enjoy! /** * Return a Javascript Date for the given XML Schema date string. Return * null if the date cannot be parsed. * * Does not know how to parse BC dates or AD dates < 100. * * Valid exam...

[Javascript] Pop-up close and parent window refresh not working

Hello people, I can't get this working. Here's my code. <script type="text/javascript"> function close() { window.opener.location.reload(); self.close(); } </script> <hr /> <h6> Thank you for uploading! Click <a style="color...

Scoping inside Javascript anonymous functions

I am trying to make a function return data from an ajax call that I can then use. The issue is the function itself is called by many objects, e.g.: function ajax_submit (obj) { var id = $(obj).attr('id'); var message = escape ($("#"+id+" .s_post").val ()); var submit_string = "action=post_message&message="+message; ...

Twitter Client using JavaScript and Oauth

Is there any good tutorial or example to build a Twitter client using popup and oauth for login (Ex: http://twitgoo.com/) Also once the user logs in, the new tweets showed without any page refresh and also the ability to post a tweet without page refresh. If there is no good example, please suggest the API or libraries i need or a...

How to hide optgroup/option elements?

Is there a way to hide option or optgroup HTML elements? I've tried calling hide() in jQuery, and also using regular Javascript to set style.display='none'. It works in Firefox but not in any other browsers. Actually removing them from the DOM does work, so perhaps there's a way to save each DOM element when it's removed, and reinsert t...

JSON stringify standalone function for JavaScript

I know of YUI who has a JSON.stringify utility and also of JSON2 from json.org. What are other good implementations of JSON.stringify? It should also work in IE6, IE7 and not depend on a framework. If it depends on anything this should be easily included all in one file. Edit: I could easily use jquery-json, which was suggested in t...

Add items to js array with UpdatePanel

I'm creating a javascript array in an overridden PageLoad() event on a class that I'm including inside my UpdatePanel using something like this: Page.ClientScript.RegisterArrayDeclaration("myArray", "'one','two','three'"); I have a button I'm using to "Post Back" (with ajax since it's in an update panel) that then shows a specified nu...

Javascript JQUERY AJAX: When Are These Implemented

I'm learning javascript. Poked around this excellent site to gather intel. Keep coming across questions / answers about javascript, JQUERY, JQUERY with AJAX, javascript with JQUERY, AJAX alone. My conclusion: these are all individually powerful and useful. My confusion: how does one determine which/which combination to use ? I've co...

prevent form from automatically re-submitting on page load

I am using jQuery to point a form's target to an iframe on .submit(). This is to upload a file. It works fine, but when the page reloads, and the iframe is appended to the DOM, the iframe automatically resubmits the form, causing the same file to be sent to the server on each page load. If I do not include the iframe in the HTML markup,...

jquery slider - mc is not defined

Hi guys I have currently implemented this image slider http://www.dreamcss.com/2009/04/create-beautiful-jquery-sliders.html on a site but for some reason I get the error message "mc is not defined". Unfortunately I can't show a link to the site since it's not accessible to the public yet. When I look in the javascript file I can see t...

How I can combine Google maps API and others (maps.andex.ru or Bing) in one application

There are many services, where user can switch API: gpsies.com, gdeetotdom.ru/map etc. How I can develop common map factory? Have anybody some tutorials or examples? ...

IE Specific JavaScript

This feels like a stupid question, or one that could be answered with a little trial and error and some Googleing--but I assure you I have tried both and several ideas and am not getting the results I'm after. Here are my JS includes for a site: <!-- JavaScript --> <script type="text/javascript" src="http://code.jquery.com/jquery-lates...

How do I create a popup to submit form data?

I did see this post which lead me to the UI/API/1.8/Dialog I'm looking for the most basic popup to submit form data. Is this it? (does a popup submitting form data have to use ajax?) Thank You. EDIT - Sorry, to clarify, I mean that the popup contains the actual input fields and the Submit button as well. I did see the jQuery example...

Javascript DOM ready without an entire framework

Hello, Does anyone know of a good javascript DOM ready library that I can use without loading an entire framework? I found one on google code that seems to work, but the library was posted in 2008 and I can't find any confirmation on up-to-date cross browser support. Thanks, Brian ...

Passing a variable to jsp when reloading an iframe using javascript

In my javascript code I load a jsp page in an iframe and pass some variables like this: htmlData[i++]="<iframe id=\"mapframe\" frameborder=\"0\" style=\"width:330px;height:300px\" src=\"" + "mapURL.jsp" +"&lat=" + AjxStringUtil.urlComponentEncode("33.65") +"&lng=" + AjxStringUtil.urlComponentEncode("-84.42") +"&a...

CSS Pop up box that works in all browsers

I want to display a pop up box when a visitor clicks on my google map marker. I already have the text I want to display when they click the marker. ...

Getting Occasional Errors Returned Instead of PHP Images

I have a script that colors the requested country on a world map with GD and PHP. The PHP requests are called with checkboxes. It kind of looks like if you call the PHP scripts too fast then it returns an "Xed out" error image. Is there a way to queue the PHP requests with setTimeout or something else, so a new checking event never fa...

Why GLatLng() doesn't receive variables?

Hi, i have the following code to update a google map: function updateit(c1,c2){ alert(c1+"-"+c2); // This works map.setCenter(new GLatLng(c1, c2), 13); // But this doesn't } updateit(37.4419, -122.1419); The alert is working and show the two coordinations, but i think the GLatLng() doesn't receive them, so the map is not updated unl...