Here in stackoverflow, if you started to make changes then you attempt to navigate away from the page, a javascript confirm button shows up and asks: "Are you sure you want to navigate away from this page?" blee blah bloo...
Has anyone implemented this before, how do I track that changes were committed?
I believe I could do this myself,...
Basically this is a question how to access local scope handler. I trying to achieve something similar for global variable definition like:
window['newObject'] = "some string";
alert(newObject);
but for local scope. Right now only solution I have is using evals:
eval("var newObject='some string'");
But this is really ugly solution.....
Does Javascript or jQuery have sometime like the "in" statement in Python?
"a" in "dea" -> True
Googling for the word in is hopeless :(
...
statement written with jQuery, How whould i write this with prototype
$("#productNav li a").click(function(){
$("#productNav li a").removeClass("selectedProd");
$(this).addClass("selectedProd");
$("#productListCntnr > ul").slideUp(300);
$("#productListCntnr > ul."+this.id).slideDown(300);
});
...
I have 'n' number of textbox on a form, after the user enters a value in a textbox, i need to validate its not a duplicate in the other textboxes.
Ex :
Textbox[0] : 1
Textbox[1] : 2
Textbox[2] : 3
Textbox[4] : 1
For this example it should alert saying that '1' have entered twice.
Let me know what to be done.
...
I have an image slider that I built for my website, and I have it set to slide every 3 seconds (will be slower after diagnostics, but I don't like waiting 10 seconds to see what's wrong). I also have it set so that before it auto-slides, it checks if the toSlide variable is set to 1 (default) or not. When the user clicks on a next/previo...
>>> var date_time_datepicker = jQuery('#date-time-date').datepicker({inline: true});
>>> date_time_picker.getDate();
#=> undefined
...
I have a unordered list:
<ul id="sortable">
<li id="1" class="ui-state-default">First <a href='#' title='delete' class="itemDelete">x</a></li>
<li id="2" class="ui-state-default">Second <a href='#' title='delete' class="itemDelete">x</a></li>
<li id="3" class="ui-state-default">Third <a href='#' title='delete' class="itemDelete">x...
I'm using a list to build a simple nav menu, that shows when you hover and hides when you leave it. I want the menu (ul) to appear when the a tag is hovered, and only disappear when mousing out of the entire div. However, the code below is hitting the mouseout when every tag is moused out, not just the div tag. I assume each child tag...
I have a dropdownlist with values. On a click of a button a unordered list gets appended with an <li> with details from the selected item in the dropdown list.
The <li> has an <a> tag in it which will remove the <li> from the <ul>.
I need to repopulate the dropdown list with the item removed from the <ul> when the <li> is removed.
Any...
Hi!
Is it possible, in Javascript, to prompt user for downloading a file that isn't actually on the server, but has contents of a script variable, instead?
Something in spirit with:
var contents = "Foo bar";
invoke_download_dialog(contents, "text/plain");
Cheers,
MH
...
What are your tricks on getting the caching part of web application just right?
Make the expiry date too long and we'll have a lot of stale caches, too short and we risk the servers overloaded with unnecessary requests.
How to make sure that all changes will refresh all cache?
How to embed SVN revision into code/url?
Does having mult...
I am building a 'keyword' highlighting script and I need to write a regular expression to parse the following url, to find the searched for keywords to highlight.
I am REALLY bad with regex, so I was hoping someone who rocks it, could help.
Our search string uses "skw" as the parameter and "%2c" (comma) to separate terms, with "+" for...
I am trying to create a dynamic pagination system for my website and I've decided on using ajax callback function to dynamically show the comments when the user clicks on different page elements..
So I'm pasting the code below as an example as to how I am doing it...I would like to ask you guys if I'm doing it right or if their is any be...
I am trying to run jquery through a rails app. I have the edit information in a popup window and i want to change that to show information after they click update. It should work but this line
$(".edit_business).append("<%= escape_javascript(render(:file => 'businesses/show')) %>");
is throwing an illegal character issue. This code i...
I have been trying to make a div fade in evey 30sec and out after 30sec
setInterval(function(){$('#myDiv').toggle();}, 300);
$("#popupboxdis").fadeIn("fast");
$("#popupboxdis").fadeOut("fast");
...
Hey, I have been trying for over a week now to slideToggle a table row when the 'more info' button is clicked but nothing seems to be working at all.
I'm new to Jquery so if anyone ca help me slideToggle the 'more-info-1', 'more-info-2', 'more-info-3' tr tags. the main problem is that those id's are created dynamically through php and I...
I'm asking to pick the brains of all you web gurus out there.
I have an idea I'm trying to implement.
I want to display half a dozen pictures on a screen, in say a circle shape, and as I hover over one with the mouse it fades from grey and white into full colour, maybe even getting a little larger, or generating a drop-shadow effect wh...
Looking for something like:
$("input:radio:checked").previous("name", "original_name").attr("name","new_name");
I tried a few different seen around here but mostly get the error: Object Expected
Any help is appreciated.
...
Hi everyone, I have the following code. I need to see how many checkboxes have been checked in my form and if there are 4 or less submit the form and if there are more display an error and don't submit.
function SetHiddenFieldValue()
{
var checks = document.getElementById('toppings').getElementsByTagName('input');
var toppings ...