javascript

Any short code for this in php?

I have a picture uplaod tool which reloads the page (which contains a form) whenever a picture is chosen. I have this code to "remember" the drop list options selected, so basically I am creating options using php: $posted_type=$row['9_type']; //From mysql db $types = array('Clothes', 'Bags', 'Others'); $category_table .= "<select nam...

Show as an alert instead

I have these lines in a script which I'd like to show as an alert instead: mce_jQuery('#mce-'+resp.result+'-response').show(); mce_jQuery('#mce-'+resp.result+'-response').html(msg); but the alert displays it as-is, what do I need to change? ...

Javascript: Show second textbox on keypress

I have two textboxes (pass1 and pass2). I want for pass2 to be hidden and only appear when something is entered in pass1. Pass2 should hide when pass1 is null. ...

javascript location.href onchange event listener?

I want to show a message whenever you are leaving the page (not an annoying alert, just some html telling you to wait), in thinking about it I'm facing certain difficulties: when the user presses Stop in the browser, cancelling the navigate-away action, I'd like the message to go away. whenever any link is clicked, the message should a...

javascript drop-down menu: how to link to different sites?

I'm a college student trying to create a drop-down menu for my professor. Since I don't have any programming background, I found a program called "SoThink DHTML" that generated a code for me, but there are some errors within that I don't know how to fix. The menu, overall, should have tabs to "Home," "Research" (3 subtabs: "Research Pro...

Getting a Google API Key

How do I get a Google API Key if I'm developing a Chrome extension (i.e., address is local)? ...

Custom drop-down in yui editor toolbar?

Hi all, I'm working on a CMS where the administrators have the chance to edit all of the mails sent by the system. I'm using the YUI Editor for this. Now the admins can see the content of the e-mails and also the pre-defined values in e-mail like {link}, {first_name}, etc. Now I'm thinking how could I integrate these pre-defined valu...

Regular Expression in Javascript

I need to convert a text entered in a textarea, to a form like: word1|word2|word3|word4|word5 How can i do this? ...

Facebook Like Box - monitoring clicks

Is it possible to somehow monitor who "Likes" my Facebook page, by intercepting the clicks in the Facebook Like Box? http://developers.facebook.com/docs/reference/plugins/like-box I would like to find out if the user who comes to my site already likes it, and enable some additional functionality based on this (for example, less advert...

Second GetelementbyTagname in another GetelementbyTagname

hello, i am parsing a XML string to an XML Document in Javascript. The xml structure might look like this: <parent> <parent2> <x> <y1/> <xyz> <tra/> <xyz> <y2/> </x> <x> <y1/> </x> .. </parent2> </parent> Now i wa...

Form validation; Get all "input type=text" and validate?

I have a form which is dynamic. That means, the inputs names are changed, and not the same, but they are all the same "TYPE". So I need to have a javascript which gets all input type="text" and validates them. Is this possible? If so, how? All I need to check is so that they are not empty, and that they are only numeric. Thanks ...

The simplest JavaScript in the world won't work!

I have this script in the separate Sample.js file: function MyPrint(text) { document.write(text); } And I have the following HTML page: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml"&gt; <head> <title>Silly example</title> </head>...

Sending currency symbol from php to flash

Hi , I am having many websites . In that I have to send some parameters from php to flash. All the parameters are getting correctly displayed in flash except the currency symbol. These currency symbols are extracted from db to php in form of html entities like(& pound;). I can't change the db as it will require many changes in all websit...

ajax: how to reopen a div after closing using ajax

Hello all; I call a page with ajax in a div. when the page opens, there is a "close "button to hide the div. After clicking the close button, I need to refresh the page to reopen the div. What should I do to open and close the div as much as I like without refreshing the page? code: <script> $(document).ready(function(){ $('#close...

AJAX (XMLHTTPRequest) time delay

Hello. I am new to AJAX and have this issue. I am creating a photogallery page and on it I created a Javascript class which manager the whole thing. Here is a method from the class which calls XMLHTTPRequest object which was initialized successfully earlier: this.AJAX_update = function(id) { //initialize AJAX - this is done success...

What is !! in javascript ?

Possible Duplicate: What does the !! operator (double exclamation point) mean in JavaScript? $("#imjavascript").attr('checked', !!$('#mainCheck').attr('checked')); what do !! mean ? ...

Set button focus next to field so that it uses either Enter or Mouse click with jQuery

I want to be able to either Press the enter key or click the mouse to submit the info in the inputbox. Right now when you manually change focus using tab or click with mouse it will submit the info. It is using the jQuery live Click method. I found this solution for setting focus to a button http://stackoverflow.com/questions/3839342/...

Google map (v3) infowindow opening on the same marker all the time...

I create several Gmarkers (from JSON data loaded by JQuery "load" function), on all of them I add an event listener to open the infowindow object I created before on the marker, and then I add them all to the map. The issue is that the infowindow always opens on the same marker. I all had this working before, i can't see where the prob...

jQuery autocomplete won't show more than 10 results

I'm using the jQuery autocomplete, and no matter what settings I change, I can't get it to show more than 10 results in the dropdown. I can see in the results coming back that I'm getting all of them from the server, but the front end won't show more than 10. $("#add_cpt_code_text").autocomplete('<%: Url.Action("SearchCPT", "ChargeCapt...

javascript eval and object evaluation

I have a part of a debugging framework that needs to be able to run time eval objects. Specifically, if I have a string like this "{a: 1, b:2}" it needs to evaluate it into an object with members a and b with those values. However, if I do eval("{a: 1, b:2}") it seems to evaluate it as a statement, and says something about an illegal la...