file1 and file2 have the same code. Why doesn't file 1 work?
[file1] <!DOCTYPE html> <html> <head> <script src="https://code.jquery.com/jquery-1.11.2.js"></script> <script> $(document).ready(function (){ $("#bigs").click(function(){ alert('hhaa'); }); }); </script> </head> <body> <div id="bigs"> bigs </div> </body> </html> [file2] <!DOCTYPE html> <html> <head> <script src="https://code.jquery.com/jquery-1.11.2.js"></script> <script> $(document).ready(function(){ $("#bigs").click(function(){ alert('haha'); }); }); </script> </head>
Php on load function..?
I'm using the following code, the problem is on each page load the token should generate random string, the string is generating in localStorage but when im using php code there is only one constant string which isn't changing. $(window).load(function(){ $.post("SetSession.php",function(data){ localStorage.setItem('token',data.Token); <?php $_SESSION['token'] = getToken(); ?> },'json'); });
Newbie to AJAX: creating a counter
To get my feet wet, I have a simple page where I start a loop and I want to display the count: <body> <?php $rvars = $_REQUEST; if (isset($rvars["start"])) { for ($i = 0; $i < 10; $i++) { // The count variable $count = $i; sleep(1); } echo "Finished"; } ?> <h1> Test AJAX counter</h1> <form id="countform" method="post"> <div> <label for="start_button">Press to start:</label> <input type="submit" value="Start" id="start_button" name="start"
How can convert option text to string.
I have a select in HTML and insert data to this OPTIONS with JSON but these text is this Format: [object object] now how cant convert this format to real string
importxml and jquery
This is not directly related to jQuery now. But I will merge it with jQuery. This issue has annoyed me for many months. [Study Material] http://importxml.org/tag/import-xml-to-spreadsheet/ [What I want] =importxml(A2, ʺ//div[@class='ledStory']//h2/a/@hrefʺ) if you have a gmail accocunt, you can use the Google Docs.
a button that becomes avertical tabs
I need to add a code that displays a standard button. When the user hovers over it, it becomes a 3 clickable vertical tabs, each one with its own title and functionality. I don't even know what is the exact name of this technique(not to mention to implement it) Can someone advice or give a relevant link? Regards I. Sher
jQuery selector unable to find outer most DIV
Hello folks, I found an interesting issue while working with jQuery selctor. Please share your ideas on this issue. Here we go Below is my jQuery syntax which looks pretty good. But I don't understand why selector unable to produce expected result!!! var testHTML="<html><head></head><body><div id='outerDiv'><div id='innerFirstDiv'></div><div id='innerSecondDiv'></div></div></body></html>" Well, here #outerDiv is the outer most div and #innerFirstDiv & #innerSecondDiv are two children div of #outerDiv
checking why a line was added to a plugin using the history tab .
hey guys just a quick question about Jquery code on github , i was just going through the code on dropdown.js on git and saw the following lines of code : var desc = ' li:not(.disabled):visible a' var $items = $parent.find('[role="menu"]' + desc + ', [role="listbox"]' + desc) now what the query inside find actually evaluates to inside find is : "[role="menu"] li:not(.disabled):visible a, [role="listbox"] li:not(.disabled):visible a"; what i actually want is i want to take this line :
Child element not firing parent click with .on()
I'm struggling to get a child element to fire the parent click event. If you click on the span the event is not fired but clicking on the div itself fires the event. Any ideas what might be happening? <div class="jqAction" data-jq-action="Pop"> <span> Pop </span></div> $('body').on('click', '.jqAction', function (e) {}
want to do some ajax on browser/tab closed event
Hello Team, I want to do some ajax coding on Tab/Browser close. Is any way to identify the browser close and get it work as need. I have tried some code but not able to get it success. $(window).bind( 'beforeunload' , function (){ return '>>>Before You Go<<<<<<<< \n Your custom message go here' ; }); Its work but not able to customize, If any reference link so it will really helpful. Thank You Jay
How to validate SELECT?
Hi, I am using below code for a SELECT and for validating it but it's not working... I am mean it' considering it valid even if no value! How can I fix this please? <span><label>Birthday</label></span> <span> <select id="cboDay"> <option value="">[Day..]</option> <option value="01">1</option> <option value="02">2</option> <option value="03">3</option> <option value="04">4</option> <option value="05">5</option> <option value="06">6</option>
Slideup, remove, add new div/content
Hi So im trying to make my content slide up when im clicking on a button, then I want it to remove, add new content(div etc) and then slide down again, but it only slides up and adds the div. My div is set top height:100px and it goes over my border? Im trying to do something like this: http://leaguerewards.net/ Enter something in the input and then press generate and then the whole content slides up and something new adds and it slides down smoothly :) <div id="wrapper"> <div id="top"> <h1>League
How to Implement autosave for every 15 mins if cart is modified
I have below jquery, where cart will be saved on a click of 'Save' and default session timeout is 90 minutes. But if cart is modified I want cart to be autosaved for every 15 minutes. if cart is not modified then after 90 minutes session is kicking out the user which is good. User can enter the cart using key board or number pad var _currentInputMode = 'K'; var _sBgColorSelected = "#FFF6D3"; var _sBgColorUnSelected = "#FFFFF7"; var _dragStartCell; var _dragEndCell; var _dragStart = 0; var _dragEnd
Creating dynamical handlers
how can i add event handlers into <div>s that were created with dynamic class names using php? i mean, i have divs with the names of "danny1","danny2","danny3","john1","john2","larissa1","chloe1","chloe2","chloe3" and so on.. is there any way i can dynamically add event handlers to each of these divs? i tried to add a small jquery snippet within the php loop itself so it will create an handler after printing each <div> using php's echoes but it seems like a messy solution for me since it adds loads
Having trouble with remove
I have a new search suggestions feature that works, but I can't get it to disappear when the user clicks off. I have tried a variety of methods to get this to work. I just can't figure it out. Here is the function I have come up with up to this point: <script> var windowObj = window; windowObj.onclick(myfunction(){ $('.results').remove(); }); </script> <div id="results" class="results"></div> I know I need code to exclude the clicks on the search results, but I just want to get this part working
jquery on and off events
hi i am using jquery 1.7.2 in my code i have $(document).off("click",".classname", func).on( "click",".classname",func); $(document).off("click",".classname1", func1).on( "click",".classname1",func1); For the first time onclick of ".classname" & ".classname1" triggers once, but fromt he next time it triggers twice and I have other class elements too having click events and it fires multiple times as I click on new events. Can somebosy please suggest a solution to avoid multiple firing on the click
PHP and jQuery
Well, I have a table that is being created dynamically out of mysql data depending on the GET parameters that are being passed. I would like to 'inject' some jquery via PHP's echoes into the same page that will add some event handlers when each row is being clicked. For example - http://www.mydomain.com/getdata.php?range=year&name=danny gives me the next table - <table> <tr><td> <div class=<?php echo $_GET['name'].'1'; ?>> Some data here within a class 'danny1' </div> </td> <td> Another data here
For loop with jQuery
Would you know why my "for" loop integration is not working here? I turned the original, repetitive code from… $('#redvalue1').on('input', function() { redslider1 = $('#redvalue1').val(); redslider2 = $('#redvalue2').val(); redslider3 = $('#redvalue3').val(); redslider4 = $('#redvalue4').val(); greenslider1 = $('#greenvalue1').val(); greenslider2 = $('#greenvalue2').val(); greenslider3 = $('#greenvalue3').val(); greenslider4 = $('#greenvalue4').val(); blueslider1 = $('#bluevalue1').val(); blueslider2
Martin baffled!
I am using a Jquery plugin to validate my simple contact form, works fine on the Google Chrome browser. The IE browser is sort of validating the form, it highlights red around the inputs if you don't put any character in them, it displays a required field, but my minlength rules doesn't work, all you have to do is add a character and the form validates. Weird , if anyone has a suggestion please help!
please i have this sample code,but i want to add more textbox like having questions then sub question
<script> var count = 0; //<strong>Applicable keywords:</strong><p id=\"key'+count+'\"></p>\n\ $('#addQuestion').click(function () { count+=1; if (this.id === 'addQuestion') { $('#questions').append('\ <div class=\"col-md-12\">\n\ <div class=\"alert alert-info alert-dismissible alert'+count+'\" id=\"qkey'+count+'\" style=\"display: none;\" role=\"alert\">\n\ <button
Simple question about the efficiency of $().addClass
Reading through the jQuery uncompressed code, I noticed a lot of functions have the "proceed" validation variable. Specifically I'm looking at the addClass function: proceed = typeof value === "string" && value; Wouldn't doing a null check first be more efficient? If it were null wouldn't it return false on the first check instead of doing at least two checks? proceed = value && typeof value === "string";
Dialog width is not working in FireFox
HI, I have this dialog : dialog = $("#dialog-form").dialog({ autoOpen: false, height: 500, width: 720, modal: true, buttons: { "Create Rename Rule Type ": addUser, Cancel: function() { dialog.dialog( "close" ); } }, close: function() { form[ 0 ].reset(); allFields.removeClass("ui-state-error"); } }); It's working fine in Chrome, but not in Firefox. thanks.
Problem with create div section and button inside from a form
Hi: I am trying to create a div and inside a button with their properties css, from a form but in browsers listed and said button disappears ( department ), which after I'll add employees, my code is correct because dreamviewer live mode works well , without disappearing . alguen know what is happening please thank you.
Page Transition, Removing Content Scroll.
Hi, with JQM is it possible to transition to a page without the current content of the page you are viewing defaulting to the top of that container before doing the necessary transition. Thanks in advance.
Making an interactive flag by constructing div's in columns and rows, and a clickable div too.
html section <!DOCTYPE html> <html> <head> <link rel="stylesheet" type="main/css" href="main.css" /> </head> <body> <div class="grid"> <div class="col"> </div> <div class="col2"> </div> <div class="col3"> </div> <div class="col4"> </div> <div class="col5"> </div> <div class="col6"> </div> <div class="col7"> </div> <div class="col8"> </div> <div class="col9"> </div> </div> <script src="https://code.jquery.com/jquery-2.1.3.min.js"
Avoid multiple clicks to submit a form in IE...Works well in chrome...
Please find below file code where multiple file upload functionality is given. On click of upload link it opens input file browser window where we select file and then click on submit. In chrome, submit button submits the form on first click but In IE, it does not submit the form on first click. In IE, If we select one file using upload link then submit button submits the form in second click. If we select two file then it submits the form in 3rd click and accordingly. Please let me know how to stop
.load() and .clone() doesn't work together
Hello I would like to clone an image which is loaded with Ajax, here is my HTML code : <div id="mydiv1"> </div> <div id="mydiv2"> </div> And here is my Javascript code : $( "#mydiv1" ).load( "/myimages.html" ); $( "#mydiv1 img" ).click( function () { $( "#mydiv2 img" ).remove(); $( this ).clone().appendTo( "#mydiv2" ); }); But nothing happens, any ideas ? Thank you !
switching languages -- need to make accessible...
hi, I have a site where you can switch betw two languages, I'm testing for accessibility in FF by turning off CSS.. I'm hiding elements in the non-default language (language that's not the 'current' language... lang is set when pg loads (done w/local storage) or when user clicks on lang cta... right now when load in FF w/o CSS, elements in both lang's load... I'm hiding the non-current lang in jQ by using .hide(), but this does not work when CSS is turned off... but other aspects of JS do work
Need help creating a console/terminal
Hi Fokes. So im trying to make a animated console with jQuery So far I have just made a div and entered alot of <p> tags in it, with some styled <span>. It looks like this so far: http://prntscr.com/6p9rhq I wan the text to come 1 by 1 under each other ofc, since i made the p tags, with some sort of delay. The div is fixed, so I want the text to continue under the title bar thats in the div. I thought I could make something like this $( "#consolebg" ).append( "<p><span class="author">Generator></span>Preparing
JQUERY AJAX Success
Good Evening, I have been hunting around for a solution to my problem and I cant find one anywhere! (So if its out there and I have missed it, I am very sorry for wasting any ones time with this post.) I have an Ajax call (shown below) that calls a php page to return some data pre-formatted into html. The call works fine and the data is returned into the value 'html', I know this (I think) because if I change Line 11 to Alert out the Data I can see it. My problem is I would like to change the success
Internet Explorer z-index problem with lightbox popup - can jQuery fix it?
Hi folks, I am working on a site and seem to be having a major issue with Internet Explorer and z-index. If you visit this website and click the "Rewards Store" down the left hand column, it has a lightbox popup that creates an overlay but I cannot get the overlay to go behind the login box popup. www.allfix.co.uk Any assistance would be much appreciated!
Add multiple new <li> items in existing <ul>
Hello, I'm able to add one <li> using .insertAfter, .append or whatever. However as soon as I try to add multiple <li> items it fails. Any ideas? Thanks, Emma
URL redirection after login.
I'm using the following code, where the token is generated on page load. when the login is done it is redirected to AfterLogin.html page, the below code is for, when user entered to index.html page in another browser tab it will be redirected to AfterLogin.html page, the problem is even after the user is logging out and after page load it is redirecting to AfterLogin.html, How can i prevent that? $(window).load(function(){ if(localStorage.getItem('token')==null){ $.post("Session.php",function(data){
Need help submitting form using .submit()
Hey Guys, I am trying to simply submit a form when clicking the enter key. For some reason the form does not do any submission. It will do other things like if I do an alert("Hello World") when clicking on enter but not submitting the form. Can someone help me figure out why this isn't working below is the code Thanks <form id="form" action="radio.html" method="post"> <input id="1" class="rad" type="radio" name="rad"> <div class="text_1"> Some text 1 </div> <input id="submit" type="submit" value="submit"/>
Auto adjust interest rate base on selected terms
I have text field where users will input the terms example, (24,12,8) months, and I have text field for rate where the result of terms and given multiplier will show. I want the rate will auto adjusted when I change the terms. based in given computation. example only: 24 (months) x 0.02 (given) + 1 (given) = 1.48 (rate) The problem is I didn't get the correct result on rate field when I change the terms. any ideas? This is what I've done <script type="text/javascript"> $(document).ready(function(){
Cut paste event for samsung
Hi, I'm using cut paste events for my web application. but its not working for android devices like samsung s2/note. I've used like: $("#txt").bind("cut paste",function(){ alert("Hi"); }) <input type="text" value="hello">
Help putting a variable into an advanced filter / selector
I have 10 svg shapes in a row, left to right, all with the same class st1 . Separate are 10 buttons that set a variable x to the corresponding number; press button 4 and x = 4. What I'd like to do is change the colour of the svg shapes, less than and including 4 turn blue, five and above turn grey. Within a function, this works but isn't what I want. I'd like to replace the numbers in brackets, e.g 4 and 5 in the example below with whatever the value of x is but putting in x doesn't work. I'm new
Select Option Relation .
http://jsfiddle.net/kdpfdeau/10/ when the option Default Timings (by default) is selected, the from and to options should be disabled, i disabled but when changing it for second time it is disabling, when loaded it isn't disabling the from and to options. I hope you understood.
show warning or alert to my website user that please update their browser if hey are using old browser
how can i show warning or alert to my website user that please update their browser if hey are using old browser
Capture response and post
Hi folks, I could really use your expertise to achieve the following... Connect to a web page The response from this page will load some JS that should do 3 things... Grabs the response body Locates the action for a particular button, which is a URL with query string Submits it as a POST back to the same page, with query and body dataThe challenge here is that we cannot access server side code, so it needs to be entirely client side Thanks
Next Page