javascript

Multiple DropDownLists - Call Single Function with ID

I have the following code which toggles the visibility of one of a pair of DropDownLists based on the selected radio button. This code works but my problem is that I have several sets of controls just like this on a single form. How can I use a single JavaScript Toggle() function, irrespective of the ID of the RadioButtonList that trigge...

Javascript: Inherit+modify associative array?

I'm looking for an elegant way to override values in an associative array. For example, say I have my base options as: var base_options = { hintText:"something", borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED, width: 200, height: LABEL_HEIGHT-4, font: {fontSize:16}, left: 95 } I want to use this as the base, but b...

How to get values from a form and send it to Java class using javascript?

First i have declare that i am new to javascript. I have created a form that gets Id, Name, Age & Dept. I want it to send to java class and i have to show back the data along with the other data in the data Base using DWR. For this i already done coding for showing the table, below that i have my form. After the form "Save" button call...

open pdf file from javascript?

How can I return an Open/Save dialog box to a PDF file on the server using only javascript? I don't want the current pages location to change, however. Do I need to trigger an Iframe? ...

javascript scoping issue inside a function call

I'm having a really hard time figuring out the scoping issue with the following script using the Google Maps API v3. I'm trying to geocode an unknown number of records (pulled from a database) and create a PolyLine from the results. There's some ruby sprinkled in the code, but it shouldn't be relevant to the JS right? var trippath = n...

Where should this URL point to if I am using Java instead of PHP?

I have the following jqGrid script: jQuery("#editgrid").jqGrid({ url: "editing.php?q=1", datatype: "xml", // ... Where should the url point to if I am using Java instead PHP for creating the crud? ...

jQuery MultiFile doesn't work in webkit based browsers

I'm using the jquery MultiFile plugin to upload files. In Firefox this is working fine but once I test in a webkit based browser this fails. Has anyone got experience with this? I've googled around and the only usable information I found was a fix that didn't work for me. http://code.google.com/p/jquery-multifile-plugin/issues/detail?id...

Detect parent click button with javascript

Hello, I have a page with two buttons, one Button opens a popup window with the next function: function MM_openBrWindow(theURL,winName,features) { //v2.0 my_window=window.open(theURL,winName,features); } and I need to detect from that window(my_window) when the second button in the parent page is clicked and raise an alert. How can...

JavaScript Window.Open location feature not working

In my window.open I've set the location to no. As I understand it, this should open a popup window with no address bar. However, when the popup window appears it has an address bar in all browsers except for Safari. How can I open a new window without an address bar? <script type="text/javascript" language="javascript"> $(document).r...

how to crop html page, not image

I need to select a part of html page and get coordinates of selection, not image - i want to realize this like image cropping (square selection area), how can i do it? in more detail i want next: in browser on html page i'm click button, then all page are disabled and become darkgrey color, but small window is showing in real page color...

Find the DOM element containing a specific offset with jQuery or plain JavaScript

Hi, I am paging an HTML page. In order to compute the page break offsets more efficiently, I was wondering if it is possible to get the element containing a certain coordinate offset from the beginning of the page. Thanks a lot in advance for your help, Cheers! ...

Select items runs fine in Chrome et al but not on Android G-1 browser?

This little web page runs fine on my desktop but when selecting the area with a G-1 Android device (select box that says statewide..) the data refreshed with the requested data in the table but the text in the select box does not change,,, the other select boxes (month and year) work fine.. Fwiw the data is still rough and so is the gadg...

IE throws an "Object required" error when trying to use the Event Object from another window/frame

I found a JavaScript error in a script that I'm developing. I whittled it down to a pair of fairly concise pages that still produce the error: http://troy.onespot.com/static/4505/index.html http://troy.onespot.com/static/4505/iframe.html If you load the first page in Internet Explorer 8 (or probably 6 or 7, for that matter), give it ...

call ajax inside wordpress posts/pages

Sorry for this but I searched the whole web for a solution to my probleme but in vain :( What I want to achieve is creating a normal Post and adding a form to it that once submitted, goes to a database and gets back a value. I created a plugin for that and integrated it in the admin menu then set a function that queries the db : myfun...

get first element of javascript array

I have an array of objects in javascript. I use jquery. How do i get the first element in the array? I cant use the array index - as I assign each elements index when I am adding the objects to the array. So the indexes arent 0, 1, 2 etc. Just need to get the first element of the array? ...

How to detect when a frame url is changed?

Hi, I have the following: <frame src="myframe.htm" id="myframe"/> <frame src="http://www.google.com" id="external" /> How to detect any new url in the frame "external" when clicking a link on it so i can display it on the frame "myframe" ? I want to use javascript for that Thanks ...

jquery append to already appended div

Is it possible to append something to a div that was already appended? I tried but nothing happens.. (I'm not using linebreaks in the actual js) $(document).ready(function() { $('.add_text_input').click(function() { $('li').append('<div class="input_label">Untitled</div>\ <div class="edit_label"></di...

Is it possible to sanitize Javascript code?

I want to allow user contributed Javascript in areas of my website. Is this completely insane? Are there any Javascript sanitizer scripts or good regex patterns out there to scan for alerts, iframes, remote script includes and other malicious Javascript? Should this process be manually authorized (by a human checking the Javascript)...

Basic Authentication with jQuery.ajax request and jsonp

I have some local html/js files with which I'd like to invoke some remote servers via https and eventually use Basic Authentication for the request. I am encountering two problems. First is that if I don't specify 'jsonp' for the dataType, $jQuery.ajax request returns the error: Access to restricted URI denied code: 1012 Are my ...

javascript debugging in HTML file

How can I put break points in an HTML page in javascript functions to see values of variables as lines get executed. What is the easiest way of doing so? thanks ...