How to pass jquery variable to database and output value??
Hello - I am trying to set up a non-cookied counter which will stay saved at a current value for all visitors coming onto the site (and can increase the counter). It is here : http://www.kennyrosenberg.com/?page_id=19 The likes are at 0 when you first go to the page but I always want them to be saved and increasing whenever someone clicks like. The value of the variable is "i" $(function() { // generate markup $("#rating").text("Likes : " + 0); var i = 0; // add
How to pass ID as a parameter for a function
Hi guys! I've been struggling with a piece of code. I'm guessing the solution is quite simple, but I just can't find it!!! Here's the piece of code: $('.i_gal').click( function(){ $('#gal1').removeClass('gal_hide').addClass('gal_show'); document.getElementById('fade').style.display='block'; /* var exact_img= this.attr('id');*/ galleries[0].showImage(5); } ); This code should load an image gallery, and the number
Every nth element?
I can use the nth, or eq() object to target a specific element, but what if i want to target say, every 12th element? If there a jquery object to accomplich this, or will I have to use old fashioned javascript? If so, can someone enlighten me on this logic - I can't seem to work it out. thanks
My Panels are staying open...HELP!
Hi All, I am a super newbie to jQuery. I was asked to change the way some div panels are behaving. Right now, when clicked, they just stay open. I would like to add an "x" in there to close it. Is there an easy way to implement this with the current code. Here is the function for the div panels.. $('#button_friend').click(function(){ // If another panel is open and we need to close it first before opening this one. switch (strPanelOpen) { case '': // no panel open, open Friend panel strPanelOpen
How to save jquery generated modifications to HTML file?
Hello I`m using some functions to manipulate contents of local HTML files When modifications are done i would like to make them permanent by clicking SAVE / SAVE AS / EXPORT button How to save dynamically generated HTML elements into the opened file, as well as export them to another one?
Rebinding click events after AJAX still doesnt work.
Hi I have an Ajax post that gets 100 records. That runs a callback function called Update(data.d) that loops through and populates a Div container with these records each in their own Div with numbered IDs. (It also removes old Divs so that there are never more than 100 in the container. During this loop I register the click event for each <a> called 'Like': $("#" + items.id + " .vLike").click(function () { if (this.innerHTML == "Processing') return; SendLike(items.id); this.innerHTML
Convert MooTools to jQuery
I'd like to know how you would modify this to use it in jQuery, Thanks, window.addEvent('domready', function() { var work = $('work'); if (work) { var originalHeight = work.getSize().y; var openHeight = work.getElement('.content').getSize().y; work.getElements('.toggle').addEvent('click', function(e) { var tweenToHeight = null; if (work.hasClass('open')) {
scrollTop: offset().top not working in Firefox 4 or IE 8
Hello! I have this bit of jQuery: $(document).ready(function() { $('article').click(function(e) { e.stopPropagation(); var offset = $(this).offset().top - 70; $('body').animate({scrollTop: offset}, 'slow'); });It works in Chrome, but not Firefox or IE. Here is a live example: http://websitesthatmarket.com/dblog/site/ Thanks
Strange IE issue with jQuery mouseleave event
I am having the strangest issue with a drop down menu in jQuery. If you run the result below in IE you should be able to reproduce the issue. When you click or focus on the text box a drop down menu with some options will appear. If you hover over the radio labels the drop down stays in tact but when you mouse to the right of the labels the menu will disappear. This does not seem to be the case in Chrome or FF. What is even more odd is that if you change <div class="options" to <span class="options"
Popup like WEB2.0
Hello, i create with JQuery an overlay popup: $("body") .append('<div id="cl-entry-layer" style="position: absolute; top: 0; left: 0; z-index: 10;"></div><div id="cl-entry-wrap" style="position: absolute; width: 100%; top: 0; left: 0; z-index: 20;"><div id="cl-entry" style="position: relative; z-index: 91;padding: 20px; margin: 0 auto; margin-top: 20px; width: 600px; background-color: #fff; border: 1px black solid;"></div></div>');Now i try an click event to close the overlay: $("#cl-entry-layer,
Exception "Syntax error, unrecognized expression
Hi, im getting this error when on my script that rebinds functions and recreates dialogs, what could be the problem? I am using jQuery 1.5.1.min & jQuery UI 1.8.11 [Exception... "'Syntax error, unrecognized expression: "' when calling method: [nsIDOMEventListener::handleEvent]" nsresult: "0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)" location: "<unknown>" data: no] Line 0
How to change style attribut?
Hi everybody, Im trying to change a style attribut by jquery but can't get it work. I have a list of images like that: <div id="bgstrecher" class="bgstrecher"> <ul> <li class="landscapes bgs-current" style="display:list-item"><img src="path img 1" /></li> <li class="landscapes" style="display:none"><img src="path img 2" /></li> <li class="landscapes" style="display:none"><img src="path img 3" /></li> <li class="landscapes" style="display:none"><img
problem which I can not solve
$("#aPlus").click(function(){ stevilo1 = $("#txtCena").val(); stevilo2 = $("#txtKolicina").val(); stevilo2++; $("#txtKolicina").val(stevilo2); $.ajax({ type: "POST", url: "mnozenje.php", data: "stevilo1="+stevilo1+"&stevilo2="+stevilo2, success: function(vred){ $("#spanSkupaj").hide().text(vred).fadeIn("slow"); $("#hideSkupaj").val(vred); } }); skupaj = $("#hideSkupaj").val(); $.ajax({ type: "POST", url: "ddv.php", data: "stevilo="+skupaj, success: function(ddv){
Can we check if a CSS file is loaded or not.
I am developing a web application in which user can change the theme of the page. So for this i am changing href attribute of the link tag on selection of the perticular theme. Problem is that when i change the theme whole page gets messed up till the new css file is fully loaded. So how can I check if the CSS file is completely loaded or not?
Fast IE DOM replacing
Hi! What is the fastest way to replace a (big) TBODY in Internet Explorer? So far I'm doing $("#"+TABLE_ID+" tbody").replaceWith(newBody); where newBody is plain text. IE's profiler reports quite a bit of time for replaceWith. I wonder if there is something faster. Thanks, Alexander
Multiple Ajax Calls.
Hi All, I have this function that works well: $.dimScreen(1, 0.4, function () { $('#dimmer').fadeIn(); $.ajax({ type: "POST", url: "Default.aspx/Process", data: '{Irs: \'' + encodeURI(textArray) + '\',other: \'' + encodeURI (textArrayOther) + '\'}', contentType: 'application/json; charset=utf-8', dataType: 'json', success: function (response) { if (response != null && response.d != null) { alert(response.d); } $.dimScreenStop();
jQuery UI tab IE6 issues
Hello, I am using jQuery UI tabs and I couldn't traverse between the tabs. When I click on the tabs the page get reloads everytime and I couldnt view the corresponding tab section.How to prevent the page reloading in IE6? I dont get any specific error.All your answers are welcome!! Thanks, THiru
How to fix slowdown problems when parsing large xml files with ajax?
Hi, I'm trying to load info from an xml file into a table. The xml structure is roughly as follows (the actual file is a bit more complex but simplified here for illustrative purposes): <xml> <record> <id></id> <title></title> <year></year> <author></author> <journal></journal> <abstract></abstract> </record> </xml> It contains about 300 <record> entries, with each tag containing text content (the <abstract> tags
jQuery UI tabs IE6 issues!!
Hello, I am using JQuery UI tabs for user to input some form values .When I click on the tab section the page get reloads and I coudn't see the corresponding tab section. How do I prevent the page relaoding when I click on the tabs. My example code is as below. HTML Code <div id="tabs"> <ul> <li><a href="#tabs-1">Tab1</a></li> <li><a href="#tabs-2">Tab2</a></li> <li><a href="#tabs-3">Tab3</a></li> </ul> <div id="tabs-1"> <p>I am in tab 1</p> </div>
Using JQuery unable to access code behind functions
Hi, I am new to Jquery Please help me.I am trying to access the function in server side on click of my button but its not working. I am using http://jqueryui.com/demos/dialog/ I have to implement a search functionality inside a modal. This is my Div <div id="dialog_test" class="divSearchDialog" style="display: none" > <table width="100%" id="tblSearch" class="tblDragSearch"> <tr> <td> <cm:CMWLabel ID="CMWLabel1" runat="server" Text="Advanced
Calling ASP.NET codebehind function from Jquery or making Jquery window modal?
I'm working on a .NET-based (VB) collections program. There is a page in the system where users set up new cases, and at several points on this page they are taken to a different page to define certain selections on the case, causing us to save a partial record before navigating away to the next page. I want to warn them of this and give them the chance to continue or cancel. If they select continue a function in the codebehind file is run. If they select cancel I just want the Jquery warning
dosnt get parameters in code behind.
Hi, I am new to JQuery as well as this forum. I am stuked in a problem. I have to create a modal in my code which basically consist of search functionality.I used the inbuild JQery to create that ,I am adding button in my Div and on submit of that button I want the control goes to function that i have created on code behind. <div id="dialog_test" class="divSearchDialog" style="display: none" > <table width="100%" id="tblSearch" class="tblDragSearch"> <MW:MWButton ID="btnTest" runat="server" Text="Test"
Yet Another attribute selector problem, where value has backslashes (ala full domain name, "DOMAIN\user")
I have searched this forum, Google, numerous boards, and my increasingly shrinking brain and I can't understand why this is happening. Consider the following (edited for brevity): <DIV id="divCurrentUsers"> <DIV UserLogin="CMS Admin">CMS Admin</DIV> <DIV UserLogin="MYDOMAIN\juser">Joe User</DIV> </DIV> Sanity Check: $("#divCurrentUsers>div")[0].outerHTML "<DIV UserLogin="CMS Admin">CMS Admin</DIV>" $("#divCurrentUsers>div")[1].outerHTML "<DIV UserLogin="MYDOMAIN\juser">Joe User</DIV>" That's
Loaded page form submission
I project I'm working on uses jquerys load to load up pages on my site. I'm having problems using ajax forms to submit data to a .php page on these loaded pages. They tend to either not work or refresh to the defult page loaded via jquery. (document).ready(function(){ // load index page when the page loads $('#ajax-content').html('<p><img src="includes/loaderimage.gif" width="220" height="19" /></p>'); $('#ajax-topframe').html('<p><img src="includes/loaderimage.gif" width="220" height="19" /></p>');
$.post() and IE 9
Hello, I am using jquery 1.5.1 have this function function foo(section) { $.post ( "/", { task: 'section', section: section }, function(data) { alert(data); } ); which works fine for every browser on every OS except IE 9 (9.0.8112.16421). When the server returns an empty string, the popup pops up. When the server returns something, nothing happens. Any idea what the problem might be Thank you
How to select all <h/> descendants of a context element, except <h/> descendants of <section/> descendants of the context
I want to select all <h/> descendants of a context element, except <h/> descendants of <section/> descendants of the context In other words, given HTML, <whatever> <section> <!-- This element is the context --> <whatever> <h>Match</h> <section> <h>Don't match</h> </section> </whatever> </section> </whatever> - and the identified context element, I want to select <h>Match</h>, but not <h>Don't match</h> Which of the following two ways is better? $('h', context).not($('section
Dynamically created .live() events appear to be bound but not firing
I've come across an issue where I've got a dynamically created popup class that despite appearing to be bound according to Visual Event does not fire on clicking the closebutton attached to it. I'm not getting any errors in firebug and by setting breakpoints I've verified we are not reaching the code to execute. Ruling out the usual suspects such as obvious spelling mistakes/ swapping out jquery versions 1.3/1.4/1.5 doesn't make any difference. Any ideas on what could be going on or where else
jQuery tabs, prevent navigating away with preventDefault() not working
Hi all, I am checking if a form on a jQuery tab is changed, and if it has, the user should get a popup warning when they navigate away from the tab with the form or click any other link on the page for that matter. So I setup this code: $('a').bind('click', function(event) { if (formChanged == true) { event.preventDefault() console.debug('prevent'); } });in the $(document).ready() function. I can see the code is executed, but
How to select every nth element from a matched set?
I know you can use :even or :odd to get the even or odd indexes from a set, or :lt/:gt to filter down the matched set before/beyond the specified index. But what if I want to select every 5th element? And I know it's not nth-child, because that selects everything that is the nth-child of it's parent and not if it is one of the nth elements in the matched set. Is the only way to use .each(function (index) {...}); and then check if the index makes that element one of the nth items? Thanks
Render a list once it is avaialable
Hi , I am trying to make simple JQuery application with Auto complete . I need when the user types each character --> go to server and do some logic there -->then render a list from the server . I succeeded to do that .However, the only thing that BUGS me that once the response comes from the server , I must type another character in order to be able to render the list . How could I render the list whenever it comes from the server without the need to type any thing . $(document).ready(function()
multiple checkbox values
Hi i have checkboxes in the below format, <input type="checkbox" name="all"> <input type="checkbox" name="all_a"> <input type="checkbox" name="a1" value="1"> <input type="checkbox" name="a2" value="2"> <input type="checkbox" name="all_b"> <input type="checkbox" name="b1" value="3"> <input type="checkbox" name="b2" value="4"> <input type="checkbox" name="all_c"> <input type="checkbox" name="c1" value="5"> <input type="checkbox" name="c2" value="6"> <input type="checkbox" name="all_d"> <input type="checkbox"
Problem with displaying list thumbnail list in jqmobile
Hello I have a problem with displaying thumbnail list in jqmobile. If I tried> <ul data-role="listview" > <li> <img src="images/album-bb.jpg" /> <h3><a href="index.html">Broken Bells</a></h3> <p>Broken Bells</p> </li> Is everything O.K and looks it like> http://jquerymobile.com/demos/1.0a3/docs/lists/lists-thumbnails.html But if I try generate it dynamically via $(document).ready(function () { $.ajax({ type: "GET", url: "data.xml", dataType: "xml", success:
Problems whit slideToggle and is(':visible')
I want to change a value tag (div class='seeMore') ("+ if hidden" & "- if show") depending on the result of the slideToggle jQuery, but I can't even make the slide work. I know that the problem lies in the way of how I call the tag to be Toggle $(this).parents('.seeMoreContainer').next().slideToggle(1000)But can not find another way to do it because there will be multiple tags with class 'seeMore', so I have to deal with the keyword '(this)' to make the action of slideToggle to that particular div-class='seeMore'
Deleting multiple cookies
Have a section of code that is hiding or showing content in a filter setting. If a user moves back a week it will cookie the settings of the filter. The only bad thing is when a user un-selects a filter the cookie doesnt ignore that and puts it up on the next page even though you unselect that filter. Any help on how I take away the cookie filter if they un-select it? if ( filter.id == 'show-all' || $('#filters .selected').length < 1 ) { var d = new Date(); $( '#filters .selected'
jquery Autocomplete not working
I am using jquery jquery-1.4.4.js and jquery.ui.autocomplete.js. My code is as follws but there is no autocomplete pop up appearing. <script src="@Url.Content("~/Scripts/jquery.autocomplete.js")" type="text/javascript"></script> <p><input type="text" id="tags" autocomplete="on"/></p> <script type="text/javascript"> $(function () { var availableTags = [ "ActionScript", "AppleScript", "Asp", "BASIC", "C", "C++", "Clojure", "COBOL", "ColdFusion", "Erlang", "Fortran", "Groovy", "Haskell", "Java",
Gather form data into JS object
I'd like to know if there's any method to gather form data into a JS object, just as form POST would have sent it to the server. I think such method would be helpful to tweak the parameters a bit, before submitting it to server. Although I could do that via modifying 'value' of 'input' elements, I think it'd be helpful if jQuery can gather the post data in a JS object and return it (so that, for example, I don't have to traverse the form and deal with selection and radio button input elements) Maybe
Mask function
I am able to call the mask function to mask my phone number etc in specified format. Unfortunately my database has only 10 chars for phone number so when I do insert it fails. My question is how can I get only the value back in postback instead of getting masked characters as well?
What if element is not available?
Hi together! On different subpages, there are div's that i want to talk to via jQuery. Now i am wondering if it could make problems, if i let jQuery Commands in the file, but the div's are not available at this moment? For example, i have this code: $("#success").dialog({ autoOpen: true, modal: true });What if the div with the id "success" is not available? Cheers, Max
JQuery full page slider.
Anyone knows a tutorial that illustrates this effect? www.bulamu.net When someone clicks a link, the page glides/slides to reveal another page. it's pretty neat! i would LOVE to know how to pull it off! Thank you
iphone safari default to homepage on safari load
Hi - I have a jQmobile app running on iphone safari. It works fine but when I close safari and then later reopen it it resumes at the 'page' where I last was within the app. This is obviously reasonable from a browser point of view but I would like the web app to behave more like an native app and when safari is re-opened for it to somehow recognise that fact that this is a new 'instance' of the web app running and automatically return to to the 'homepage' of the web app. Hope that the question makes
Next Page