javascript

JavaScript: ajaxSubmit error

I have the following JS function triggered by a button: function uploadPicture( ) { $("form#pictureUpload").ajaxSubmit({ data: $("form#pictureform").serialize(), type: 'post', url: '?action=loadpicture', success: function(response) { $('#div-pictures').html(response); } }); ...

How do i add border in all four side of browser page

How do i add border in all four side of browser page no matter what browser, whatever resolution. Is there any such css or javascript code ? ...

How can I get this function to return value retrieved using jQuery.ajax?

I need to return dynamic loaded content. I thought this was the way to do it, but the function returns blank. What do I need to do in order to set htmlCode with the html code retrieved from jQuery.ajax? // Get directory listing function getHTML(instance, current_path, dir) { var htmlCode = ''; jQuery.ajax({ type...

Creating a stack-view control with CSS/Javascript

I Want to create a stack type control where a series of stacked sub-divs can be re-ordered within a container div. The sub-div 'views' would be the same size and absolutely positioned on top of each other. The z-index css property seems to apply z-order at the document level, which makes no sense to me- How can an element in a given d...

How can I truly master Javascript?

OK, maybe "master" is a bit strong of a word, but I'd certainly like to get better at it. I can get things done with JS for the most part, but I've always had a nagging feeling that my knowledge in the language is lacking. I believe the main problems I have with Javascript are: Inconsistent behavior across browsers Event-driven prog...

Parsing SHOUTcast server information table with Javascript?

I'm currently trying to parse the html page http://84.19.184.204:8000/played.html using JS. But it's been hard since I'm new to JS... The html page contains a table which has the history of last played songs... This list is what I want to parse. I use XMLHttpRequest() but I can't understand how to parse the elements :( Can someone h...

Is it possible to run code if visitor is from a certain country

I want to run a bit of code if, and only if, a visitor is from a certain country, is this possible and how would i go about doing this? ...

Passing value from C# codebehind to javascript

What is the best way to pass a value from C# code to javascript? Currently I am setting an asp.net hidden field in the Page_Load method. Also if I pass a value using GET like Response.Redirect("myurl.com/myPage.aspx?id=300"); how can I get the value of id from myPage using javascript? Is there a nice way to do this in jquery? ...

Internet explorer add on and the website

Is the website able to determine if a particular IE add on has been installed or not? How do you have the web page detect the IE add on? ...

What is a "related target" for an event in ExtJS and/or DHTML?

When using ExtJS I've noticed a property "Related Target" for an event. Googling also reveals that this term is used in other DHTML related contexts, not only ExtJS. So what is this "related target" and how does it differ from the normal target (which is another property of the event object)? On this subject google revealed nothing. ...

jQuery - Get URL of iframe AFTER redirection on same domain

Using Jquery, how can I get the URL of an iframe after redirection has occurred to a URL in the same domain? ...

"Object Required" error in IE8 when using getElementsbyTagName

I have the following code: if (window.XMLHttpRequest) { xmlHttp = new XMLHttpRequest(); } else // for older IE 5/6 { xmlHttp = new ActiveXObject('Microsoft.XMLHTTP'); } var url = 'payment/code/xmlrelay.php?t=rates&id=' + str; xmlHttp.open('GET', url, false); xmlHttp.send(); xmlDoc = xmlHttp.responseXML; xmlResult = xmlDoc.getE...

How to call a js function on a remote host?

Hi, how to write a program/script that will click a button on a web page? The button's function is:OnClick="func();". Firebug gives no information about the called function, so I can't call an AJAX query. :) ...

Compositing Multiple Templates in jTemplates

Using jTemplates, it is possible to composite templates like so... <textarea id="templateList" class="template"><!-- {#template RESULTS} This a template for generating a list of results {#include PAGINATION root=$T} {#/template RESULTS} {#template PAGINATION} This is a template for generating pagination through the r...

How does your rails app include javascript?

Hello all, I'm very curious how your Rails apps include javascript. For example: do you package all your js code into a single file and serve it for all requests? do you conditionally load certain js depending on controller/action? what tools or techniques do you use, ie: asset_packager, yui compressor, sprockets, BigPipe inspired imp...

Help with the jQuery Address Plugin

I have a website with ajax loaded content. Now I want to implement the jQuery address plugin for better user experience and SEO crawling. With this line $.address.value($(this).attr('href')); the address changing thing works, but how can I do the history support, crawling and so on? There is something with the $.address.change(funct...

Alert after $.post shows different data

Look this code: <input type="hidden" id="finalvalue" value="2" /> <script> $.post("/increment_in_one", { param: 2 }, function (data) { alert( data ); // this shows: 3 $("#finalvalue").val( data ); alert( $("#finalvalue").val() ); // this shows 3 }); alert( $("#finalvalue").val() ); // this shows 2...

printing a hidden tag on the page with jquery

i have some tr tags with a checkbox in each and when the user clicks on any of the checkboxes i want the content from that tr to be written anywhere on the page Here is the HTML: <tr class="gradeA odd"> <td><input id="instance_selected0" name="instance_selected0" value="2" type="checkbox"></td> <td>September 15, 2010</td> <td>Melbou...

Finding number of lines in an html textarea

I'm writing a mobile web application where scrollbars are not displayed on the device's browser. Due to this, I'm trying to dynamically modify the height of the textarea to make it bigger, however I don't know of any way to actually get the line count on an html textarea. Any help would be greatly appreciated! EDIT So I realize now t...

Including a hyphen in a regex character bracket?

$.validator.addMethod('AZ09_', function (value) { return /^[a-zA-Z0-9.-_]+$/.test(value); }, 'Only letters, numbers, and _-. are allowed'); When I use somehting like test-123 it still triggers as if the hyphen is invalid. I tried \- and -- ...