javascript

jquery how to get the button that has opened the dialog

Hello, I have a dialog that is opened by many buttons. How can I know which button has opened that dialog? $('#dialog').dialog({ autoOpen: false, buttons: { "Ok": function() { $(this).dialog("close"); }, "Cancel": function() { $(this).dialog("close"); } }, open: function(event, ui) { //HERE ::...

HTML form on Google Maps on click

Hey Guys, I'm new to Google maps and I'm wondering how would I program a Map which would pop out a HTML form when the user clicked a location on the map? I'd like the form to "pop out" of the map on screen. is this possible? I've got the following... <script> var contentString = '<div id="content"> <form actio...

Javascript Max number of checked input type checkbox

Using asp.net to generate several checkboxes. Looking for a javascript solution that will test any checkbox starting with the name pdf* to see if more than 5 are checked, then alert over that number. There are other checkboxes I do not want this to run on that do not shae the name pdf*. Thanks in advance. here is an example of my che...

performance implications of multiple JavaScript blocks in ASP.NET?

What are the performance hit or implications, if any, of: If I have multiple <script> tags on one .aspx page? Declaring variables in <script> tags of a .aspx page and calling these variables from an external .js file? ...

Is there any way to get all GET vars with javascript?

First off, I do not want what is in the URL query. I want what PHP see's in the$_GET array. This is because the URL query will not show all the params if mod_rewrite has been used to make pretty URLs So is there a way to get the query string that would match exactly what is in the php $_GET array? -- I came up with a way myself using...

Javascript HTTP GET html/text returning null/empty?

I am trying to get the html of a website using this code: function catchData(req) { console.debug("i got a reply!"); var returnXML = req.responseXML; console.debug(returnXML); if (!returnXML) { console.debug("html is bad"); return; } if (speed != currentSpeed) moveToNewSpeed(speed); currentSpeed = sp...

Make a whole div clickable

I have a link inside a div and I need to make the whole div clickable... found several tutorials on the Internet but non of them worked for me... Can anyone please help? ...

hiding div based on unchecking checkboxes

I have multiple checkboxes in a form. Based on clicking those checkboxes, I show a div section. But if I uncheck even one checkbox, that div section gets hidden. How do I make sure that div section is hidden only if all checkboxes are unchecked. Crude way can be to write my own 'display' method which will check if all checkboxes are unch...

Why does TinyMCE require typing something before being able to use the delete key properly?

I have just implemented TinyMCE and it is working fine, except that the user must type something, even a space character, before being able to delete content. Please tell me if you need more information. ...

How do you include a javascript variable in a hyperlink?

I have pretty simple code <input type="hidden" name=passtophp value=variable> The variable is created in javascript in the head of the document. Unfortunately when I put in the variable name it is captured as a string and passed through instead of the variable's actual value. How can I pass through the variable's value? Thank you!! ...

Cross-domain calls from a webbrowser

I would like to execute a cross domain http request from a website. What are my options? Javascript is out, because most browser don't allow cross domain calls. Generally the solution is to use a proxy, but that isn't an option for this project. The other things I was thinking about would be to use Flash or maybe Java. Are there any...

Need to use the browser's back button to redirect to the home page

I'm making a static HTML demo that emulates the behavior of a web portal that logs you out when you press the back button. How might one do this using javascript? Is it possible? ...

Using jQuery, how do I add elements to a jQuery object that's yet to be created?

Perhaps I am doing this wrong and suggestions on how to improve my code are appreciated. My situation is this: I have a toolbar with different elements that are populated by a callback. I do not want to use the show() or hide() commands, I prefer to use detach, but I think there should be a nice way to deal with it. Here's my code: entr...

How to embed flash in a website? it stretched up in IE6

Hi, I re-design a flash website and now there is problem with the dimension of the stage. I can see it on IE6 and old version of FF, but it looks good on Chrome, IE7+, Safari. since it was made 2 years ago, the player version was upgraded on the export to swf. The width is fine, it sets to 100% of the window, but the height looks like i...

prototype ajax statusText ,is empty on InternetExplorer

the responseText is empty in Firefox ,but ok in InternetExplorer i also log the response before returning to the client so i see my response there this is my request , i added a setTimeout but this also not helping can someone help me please , thank you var ajaxUrl = "./ajaxHandlers/ajax-handler.php"; var myAjax = new Ajax.Request( ...

Flash ExternalInterface and function callbacks question

I'm about to write a spec for a Flash developer to build a player control that works similar to the HTML5 <audio> tag. One of the key points is how to add callbacks, for example, with the audio tag you would do something like: getElementById('flashAudioPlayer').addEventListener('timeupdate', function() { // Do stuff }); Is it possi...

Setting Value in Javascript with encoded HTML

Quick question, I have a simple javascript problem that I don't know the fix to. divNext = document.getElementById("submit_button"); if(document.getElementById("page").value == 4 ? divNext.value = 'Submit' : divNext.value = 'Next &#187;'); Now the problem is that it should display the Next with two >> after it (at least if they where ...

multiple replaces with javascript

In PHP, you do this to replace more then one value at a time. <?php $string = "jak har en mamma"; $newstring = str_replace(array('jak', 'mamma'), array('du', 'pappa'), $string); echo $newstring; ?> How do you do this in javascript? ...

Dropdown with prototype.js in IE

Hello everyone. I had trouble with this script: http://loki.timon.com.ua/select/ In IE8: all works great - dropdowns work, cloned dropdowns work. In IE7: drop downs dont work. In IE8 with IE7mode: first dropdown work normally, cloned - not. People, can you help me? ...

hide scrollbar while still able to scroll with mouse/keyboard

Hello, I want to know if it is possible to hide the scrollbar, while scrolling is still enabled with mouse/keyboard. I tried to use CSS: overflow: hidden; The effect is, scrollbar disabled AND scrolling disabled. ...