javascript

Prototype/Scriptaculous Toggle Queue

I want to achieve an effect on a certain div with scriptaculous that does the following: The div will blindUp. After that effect is complete, the contents of the div will change. The div will then blindDown with the new contents. So I know there is the effect queue which is awesome, but how can the contents only after the blindUp eff...

Variable in event

I got this code: <script>window.onload = function () { var container, i; for (i = 0; i < 10; i ++) { container = document.createElement ("div"); container.innerHTML = i; container.style.border = "1px solid black"; container.style.padding = "10px"; container.onclick = function () { alert (i); } document.body....

Changing a <div> class with JavaScript

I am trying to change the class of certain tags with an onclick() event. The basic premise is to have the background image of each tag change when the user clicks on them, sort of stimulating a "menu selection". Here is the code I have: <style type="text/css"> .navCSS0 { background-image:url('news_selected.png'); width:222px...

How can I call web service methods from javascript?

Is there any way to call web services from javascript? I know you can add in a script manager to pull in the web services but I can't figure out how to access the functions from javascript once I've done that. Thanks, Matt ...

Document.domain and <iframe>s breaks the "Back" button in Internet Explorer

This is a very urgent problem and I'd be forever indebted to anyone who can lend some insight. I'm going to be deploying a widget (called the "ISM") to a third-party site. That site uses the document.domain JavaScript property to relax cross-domain restrictions (e.g., setting document.domain in "a.example.com" and "b.example.com" to bot...

returning JSON response to a ajax call prompts file download containing the response

i am submitting a from using jQuery ajax, and server is returning json response. but instead of the script, parsing the json result, the browser is prompting me to download the json response. I have had this problem before, where i forgot to return false at the end of the event handler. But this time im clueless why this is happening. ...

Newbie needs help on mouseover and map on HTML page to show images on mouseover...

Have small web page at www.peterbio.com/mom/test.htm Someone wrote the code with mouse over and creating image map. When you click on one of the purple balloons another image shows up. ***Need some help adding more code so that I can add another rollover-mouseover picture to a different balloon in image. I do not know how. But with a...

Increasing the Size of Object Frame to Remove Scroll Bars

I recently asked how to hide the vertical scroll bar using overflow:hidden. While the answer did work (the scroll bar is hidden), I am wondering why it's even appearing in the first place. I would think that including an object inside another page would automatically grow to the size that is needed unless otherwise constrained (which, ...

How do online rich text editors work?

I was wondering how online rich text editors maintain the formatting when you paste text from a webpage or document. A standard textarea box only takes text while these WYSIWYG editors seem to use a DIV. How does it work? ...

IE 7 Debug Issue - Script Error Popup

I am building a site that will not work in IE6, intentionally. IE7 Is the oldest supported IE browser for my site. I am having a problem in IE 7 when you arrive at my site. A popup says: Script Error Line 55 Char # Error: 'cms_ims' is undefined. Then you have to press continue running scripts, yes. Anyone know whats causing this in my...

jQuery cluetip('destroy') does not destroy/remove cluetip?

Hi all: I'm trying to make sense of how cluetip actually works. I have a dummy DOM structure which I did some alerts on to check if the cluetip has been removed after the cluetip('destroy') was called on the anchor element. However, the cluetip div still appears to be alive and well. This really confuses me... Correct me if I'm wron...

Get Javascript tag content

Hi I want to save a website's source code into a file using java. From the source code i want to get only <script> </script> tag contents how can i do that? ...

basic tree structure nav using prototype

Hello, hopefully someone can help. I am trying to fiddle with Prototype JS and have a question about a basic collapsible nav structure I am trying to build. The following works well except for one thing. I would like for the JS to identify if the child or 'next' DOM element is empty to not fire. The code is: Event.observe(document...

Merging multiple javascript files

I've read that merging several multiple javascript files into a single file improves performance, is that true? If so, is there an easy and error-free way of merging them, or perhaps an online-tool that automatically does that? Many thanks. ...

Newbie help: mouseover on image sometimes returning wrong image from image map

Have www.website.com/sds/ (index.htm) set up so that a mouseover on various places shows an image. For some reason image 2.jpg and 3.jpg (move mouse back and forth on blue balloon) are both showing up (not at same time) when you mouse over the blue balloon. Only 3.jpg (child in chair) should show up on the blue balloon. 2.jpg (found on ...

accessing variable modifications made from within an inline function in javascript

Hello all, I'm trying to pass local variables to an inline function in javascript and have that (inline) function manipulate those variables, then be able to access the changed variable values in the containing function. Is this even possible? Here's a sample of the code I'm working with: function addArtists(artist, request, origE...

Mootools loop morph/tween

I am new to mootools and would like to know how I could make a morph or a tween loop forever because I want to chain colors together. I asked because I don't know if there is a better way than just use a while(1). ...

using javascript to add form fields.. but below, not to the side?

Hello. So as I click the button, the javascript adds new fields. Currently it adds the new text box to the side.. is there a way to make it add below? I guess as if there were a . Here is the code. Thanks! <html> <head> <script type="text/javascript"> var instance = 1; function newTextBox(element) { instance++; var newI...

what are the ways to insert javascript to an existing pdf file (via API)

Hi, I was trying to find out any entries in the Adobe's API giving functionality of injecting javascript into the pdf file, but I couldn't find anything. I saw that there are few open source libraries that do that, but I'd like to focus on Adobe's SDK (C/C++). Are there any ways to achieve this? Thanks. ...

creating input field for html form... but adding a 'label' for it as well?

I have an html form. When you click the button, a javascript function adds a new field. I'm trying to have the function also add a 'label' for the field as well. I've tried using document.createElement("LABEL"), but that doesn't let me change the innerHtml (or maybe I'm doing it wrong..), nor add a closing Here is my code. Thanks! ...