JavaScript: Sending POST, redirecting to response
I have an image with an onclick. When the click event fires, I want to send an HTTP POST and have the window.location redirect to the response to the POST. How can I do that? ...
I have an image with an onclick. When the click event fires, I want to send an HTTP POST and have the window.location redirect to the response to the POST. How can I do that? ...
I have something like : var myMenu= [ { 'My English Title':function(menuItem,menu) { ... } }]; Now, I want the replace 'My English Title' by an other JSON structure value LOC.MENU_TITLE. I have try: var myMenu= [ { LOC.MENU_TITLE:function(menuItem,menu) { ... } }]; Bu...
What is the proper way to close an ExtJS tab programmatically? I need to make this work in IE6; although remove'ing the tab from the TabPanel works, I see an IE warning: This page contains secure and unsecure items... When I click the X on the tab, I do not see this warning. So, clearly something clever is happening when I click the...
This should be easy, but I'm looking to add an integer variable called "rental_period" to the current date and then display it in DD/MM/YYYY form. This is my code: duedate.setDate(duedate.getDate()+rental_period); $("#pricing_due").html("DUE DATE: <strong>" + duedate.getDay() + "/" + duedate.getMonth() + "/" + duedate.getFullYea...
Hello, I have a website based on a joomla template. I want to add the dock from ndesign-studio.com/blog/mac/css-dock-menu I've built a sample page for this. Here is the code : <script type="text/javascript" src="images/eklenecek/jquery-1.3.2.min.js"></script> <script type="text/javascript" src="images/eklenecek/interface.js"></scrip...
Is the hoverIntent plugin compatible with Internet Explorer? I'm having trouble plugging it into the following JavaScript: if (jQuery.browser.msie === true) { jQuery('#top_mailing') .bind("mouseenter",function(){ $("#top_mailing_hidden").stop().slideDown('slow'); }) .bind("mouseleave",function(){ $("#top_mailin...
Hi, Rather simple question here. I want to create an JS object that has a property, say, name. I want to create that object and be able to use it throughout my page. For example, what I have now doesn't work: var item = new Object(); function makeItem(title) { item.name = title; } Inside a modal dialog: makeItem("test"); alert(i...
I have a link to hide/display some text: <a href="javascript:void(0);" id="toggle_status_history">show/hide history<a/> The corresponding JavaScript looks like this: $(document).ready(function() { $('#toggle_status_history').click(function() { if ($('#status_history').is(":hidden")) { $('#status_history').slideDown("fast"...
Using Javascript to change an 's src... First time the width and height properties are being set correctly. The Second time they don't change. Why? So I've got this blank image on my page... <img id="imgCropImage" /> So the idea is that every time a user uploads an image, the uploader's UploadComplete callback will set this image's s...
Our Firefox extension displays the top 25 Bing results in a side pane whenever someone searches from Google. The results are scrubbed for duplicates. The side pane is closed by default. Only when someone views a Google results page does the side pane open. The side pane automatically closes again when someone opens a non-Google page....
I have a database of ad html, and some of them contain Javascript functions. Is there a way to have rails allow javascript: tags for a particular attribute on a particular model? To clarify further, I can bring the html up in an edit form, but when I try to submit, my browser (Firefox) says the connection is reset. IE gives me an error...
I have a javascript object that looks somthing like this: var obj = { "name": "username", "userid": "9999", "object1": { "subObject1": { "subArray1": [], "subArray2": [] }, "subObject2": { "subArray3": [], "subArray4": [] } }, "object2"...
I have a Javascript image switcher on my products page. It working perfect in IE and Firefox but both Safari and Chrome fails to load the script on some pageloads. A refresh seems to fix it but when changing product page or language it crashes. The product page Im using Wordpress and the script is varal.org/media/imageswitcher/ Thanks...
I am trying to pass a string via HTTP request which has one of the character as % in the URL query string. url = url + "?q=" + str + "&block=" + block; // str contains the '%' character But on the ColdFusion page where I'm sending this information is returning following error: Element Q is undefined in URL. Could you please te...
Hello i need to iterate xml items Sample xml <items> <name>234</name> <email></email> <phone></phone> <phone2></phone2> <phone7>33</phone7> </items> i tried lot of combinations but no success :( for example var xml=' <items><name>234</name> <email></email><phone></phone></items>' $(xml).find('items\').each(f...
I'm having a string which contains a chr(13) as linebreak. How can i replace it with eg. <br>? I tried mystring.replace("\n","<br>"); but it didn't work Thanks in advance. ...
I'm trying to create an array of <li> that are in a div. So I have var arr = document.getElementById('mainNav').getElementsByTagName('li'); For testing purposes, I put an alert("test"); alert(arr.length); to see if an alert will pop up and what the size of the array is. Neither of the alerts showed up, but if I place an alert before t...
I don't want users to see the "install missing plugin" on their firefox when a custom plugin isn't found. How do I disable this? <object height="0" width="0" id="mycustomPlugin" type="application/x-vnd-puppyt"></object> ...
If a user creates a form without a method attribute, it seems like most browsers will handle this at the time of form submission. So upon inspection of the form element after the DOM is ready, you can see that there is no "method" attr of the form element object. IE7, however, apparently sets a default method value of "GET" on all forms...
Hello, I built a nav area using css (it triggers a javascript function to bring up a sub nav). The issue I'm having is my space is limited, and the navigation area is a bit finicky feeling. http://clients.sugarpillfactory.com/fce/wp/ I'm wondering if there is a technique or method for reducing the hit area in javascript or css? Curr...