serialize array
I have an array like as follows: var a = [ ["val1", "val2", "val3"], ["val4", "val5", "val6", ["val9", "val8", "val7"] ]; I want to serialize it so that I can set it as a value of a text box as follows: <input id="input-id" type="text" name="serialization_stack" value=""/> serialized_a = serialize_array(a); $('#input-id').val(serialized_a); Can someone help me to define the function serialize_array()? Thx
Ajax calls and rework
Hi every one, thanks for your time :) I've started using a framework which consists of a JQuery front end and ASPX web methods(JSON), so far I'm really enjoying it but it is becoming painful for agile projects. My biggest issue is pretty much reworking the success responses each time and it can get messy, for example: On window open: Get person info Get company info Validate permissions Show the window once all 3 are complete. Now my boss comes back to me and he wants to add 2 more conditions before
Date picker pagecode ISO-8859-1
Hello, I'm using Portuguese pagecode: <?php header("Content-Type: text/html;charset=ISO-8859-1"); ?> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> The calendar apears like this example. How can I put this correctly? regards Jorge Barosa
Setting inner div to width more than 100%
I have a jQuery UI modal Dialog with the opening <div> being as follows: <div id="ticket_dialog" data-tooltip="Ticket Details" title="Ticket Detail"> The dialog init is as follows: $("#ticket_dialog").dialog({ autoOpen: false, modal: true, position: { my: "center", at: "top", collision: "none" }, collision: "none", height: 700, width: 600, minWidth: 600, resizable: true, alsoResize: '#ticket_paths' }); It decorates to this: <div id="ticket_dialog" data-tooltip="Ticket Details" class="ui-dialog-content
replacement of toggle function code
toggle function is depreciated so what is its replacement. i have this function and i cannot convert it kindly help me! function toggleInteractContainers(x) { if ($('#'+x).is(":hidden")) { $('#'+x).slideDown(200); } else { $('#'+x).hide(); } $('.interactContainers').hide(); }
Get target element with out passing event as perameter
HI all, i need event name on triggering the function that time i am not passing the event as perameter if i put event.target.name it is working correctly in chrome but firefox it is failing
jQuery UI Sortable disables scroll on Android
I use jQuery UI Sortable at my web. The problem is that the region of a sortable element lose touch responsiveness on Android devices, so the page becomes unscrollable. It occurs even if the Sortable function is not active. I looked into jQuery UI source code and found _refreshItems function is triggering this problem, but cannot figure out how to fix this. This problem is reproducible on Android devices and Chrome's Developer Tools with the mobile emulation enabled. It is not reproducible on iPhone.
jQuery plugin: Treeview
hello i want to use it as Rtl , how i can change the codes and make it happen ?
VB HiddenField loses value after setting value in Javascript [jQuery dialog]
I am currently struggling with the implementation of the jQuery Dialog in an Visual Basic Web Application. In the following code there is a Button, that forces a jQuery dialog to open. I just want to access the result of the dialog (Yes/No) in the Visual Basic Code. This is my VB-Code: <input id="hfSandbox" type="hidden" runat="server" /> <asp:Button runat="server" ID="btnSandbox" OnClick="btnSandbox_Click" Text="Button" /> <div id="dialog" >Everything OK?</div> With following Javascipt code i want
How to increase the number of tabs?
Could someone please have a look at the code below I have edited from JQuery to make a glossary of terms and tell me why the definitions for the terms after the first 9 do not show when I click on the tabs? Many thanks for any help. I also notice that the text sometimes spills over the boundary of the box which looks messy. <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>jQuery UI Tabs - Vertical Tabs
Modal Popup
Hi All I am trying to create a modal popup but I would like it to do the following 1. Load when the user enters the site, but only once not every time they navigate to a new page. 2. when they leave the site. again only when they leave the site not when they move from page to page. I am still busy on number 1 so I haven't started working on nr 2. I have got the popup part right but it loads every time the page is refreshed. I have been trying to play with cookies but then it doesn't load at all
jquery each
(This is my first post here) My array declaration is like below var json_array = []; I insert values in this array var keys = ['rowid', 'Leave', 'Family', 'Place', 'Country', 'fromdate', 'todate', 'Email', 'Phone', 'Remarks', 'leave_status']; $(this).find('td').each(function () { i++; var textval = $(this).text(); json_array[keys[i]] = textval; }); When i want to retrieve these values like below, i can't get any value? Whats
Localization language Portuguese
Hello, Can somewone help me and tell me why doesn't the text apear in Portuguese. <script src="datepicker/jquery-ui.js"></script> <script src="datepicker/datepicker-pt.js"></script> $(function() { $( "#datepicker" ).datepicker( $.datepicker.regional[ "pt" ] ); $( "#datepicker" ).datepicker( "option", "dateFormat", "yy-mm-dd" ); $( "#datepicker" ).datepicker( "option",$.datepicker.regional[ "pt" ] ); }); Thanks Jorge Barosa
How to get difference in hours and minutes compared to current time.
Give the followin date: 2016/11/18 21:00 I want to know what is the difference between the above date and the current date and time . I need the difference in hours and minutes , so it will be .... what is the difference between the above date and time and the currently date and time in hours and minutes. I am somehow not able to get how to calculate this :( Thank you. Gautam.
Tumblr reverse posts order
Hi everyone, I am trying to reverse the order of Tumblr posts by date. BY default Tumblr presents the most recent post at the top of the page. I would like to present the oldest post at the top and so on in that order, with the newest post at the bottom. I am new in using jQuery. I am still understanding the DOM. I saw one solution by jakecigar here to randomize Tumblr posts. But with all honesty to come up with something like that is beyond my jQuery skills yet. Copy and paste will be easy. Besides,
Hoe do you capture and pass data from an input field?
I tried the following two script but neither work. Please advise. Thank you. $("input[name='loanAmount']").mouseleave(function(){ var Amount = $this.attr("input[name='loanAmount']").val(); _satellite.setVar('loanAmount',Amount); _satellite.getVar('loanAmount'); Return true; I also tried this. var Amount = $this.attr("input[name='loanAmount']"); _satellite.setVar('loanAmount',Amount); _satellite.getVar('loanAmount'); Return true;
[Solved] function .toggle() deprecated : what to use instead ?
Hi, The documentation says that the .toggle() function is deprecated (http://api.jquery.com/toggle-event), but there isn't any alternative method indicated. I searched the documentation but cound't find this piece of information. Maybe with .on() and .off() but I don't understand exactly how it works. Well, all I want is to transform the following into something future-proof : var odd = function() { alert("odd"); } var even = function() { alert("even"); } $("#mydiv.toggle(odd, even); Thanks
Errors using latest TableSorter plugin
Hello, I just started using the current TableSorter (2.0.5) ( and JQuery 3.1.1) within my AngularJS app. I'm getting an error when I click on the table header to sort the table. The error is on line 614 of tablesorter.js and it says: caught TypeError: Cannot read property '0' of undefined(…)multisort @ jquery.tablesorter.js:614(anonymous function) @ jquery.tablesorter.js:785 My table consists of strings and numbers. For example, see attached html Any idea how to fix this? Thanks, Steve
Showing and hiding elements - Best way to organize the divs
Hello, I always try to show or hide elements and would like if there is a different way to organize numerous div. ie: <div class="main-div"><div id="element1></div><div id="element2></div><div id="element3></div></div> $("#element1").show(); $("#element2").show(); $("#element3").show(); Is there a way to add all of them into 1 class and instead show or hide each element of the class based on an ajax response data. ie: $(".element1").html(data.delivery_charge).show();
Jquery each function doesnt work
This is my array. var json_array = []; I inserted values on this array like below $(this).find('td').each(function () { i++; var textval = $(this).text(); json_array[keys[i]] = textval; });Again , i want to get them trying jQuery.each( json_array , function (i) { console.log( json_array[keys[i]]) ; });But unfortunately i am not getting any value. Whats wrong with my code? *That is my first
jQuery Mobile custom select menu not working if url has encoded parameters
Hi, I have a jQuery Mobile 1.4.5 custom select menu on my page. If url has encoded parameters then Url gets appended with id of menu and menu click event does not show option menu popup. Let me know solution for this please. Not working when url is as below http://localhost/GI/SubmitSecureForm.aspx?ENCDATA=JalT6QGRlGk%3d Working when url is as below http://localhost/GI/SubmitSecureForm.aspx?ENCDATA=JalT6QGRlGk= Below how the control looks <div class="ui-select"> <a href="#" role="button" id="ddl_institutionaccountnumber-button"
jquery add and remove content
Hi guys i have three text boxes in a row on click of add button should add a row with three text boxes and a remove button and on click of remove it should delete the particular row.And one row is mandatory and when we have one row remove button should not appear and should not allow the user to delete a row.
Cycle plugin - undesired style
Hi There, I testing cycle plugin but I found that it add some 'unwanted' style to the 'rotating' <div>. Below an example of what devTools in chrome show if cycle is loaded. Without loading cycle the layout is fine (plain default). background-color: rgb(147, 161, 161); position: absolute; top: 0px; left: 0px; display: none; z-index: 9; opacity: 0; width: 194px; height: 93px; I am using the plugin from: http://malsup.github.io/jquery.cycle.all.js This is the element in my source file: for(var
How can i select one object from many objects in a JSON file with this jquery code
I need to get the latest blog post in the top of my page, the main area. All the posts is stored in a JSON file and when i make a new post it should come on top of my webpage to the main area. I also have a menu with all the posts listed. When I click on a "post" it should appear in the main area and when i reload the page again it should show the latest post in the main area. Hoq can i do that with jquery? this is my code so far: This is the JSON file: Code: {
"postHead": {
"title":
input mask example
Hello, I'm new to jquery. this example from JSFiddle works on JSfiddle, but I'm unable to run the same on w3schools tryit editor. http://jsfiddle.net/SEXAj/4699/ can anyone help?
Saving JSON object in cookies and read it when page loaded...
Hi, I have a json object as below.. var a1 = {"nope":["Retail Stores","Retail Development","Service station","Stations","branded wholesale/wholesaler","brand equity","Retail outlets","Forecourt","Corner store","Conveinence store","backcourt"]}; var a = JSON.stringify(a1); and saving in cookies using document.cookie = "MyTopicCookie="+k+";expires=Thu, 18 Dec 2017 12:00:00 UTC"; when I am reading cookies in next reloading of page.. using following code ( Thoudh in first reload it show previous cookies...
multiple jquery functions
I have 3 jquery functions. Do i need to put them under separate functions or i need to put them put into one function? see below: 1. put in multiple functions: <script> $(function() { $('#calc_jyform').calx(); }); $(function() { $("#checkboxID").change(function(){ $("#tableID tr.rowClass").toggle(!this.checked); }); }); $(function() { $('#checkboxID').click(function() { var cb1 = $('#checkboxID').is(':checked'); $('#emailAddr').prop('disabled', !cb1); });
Get Video url from media:content in RSS XML feed
Hello all, I am using jfeed to retrieve content from an rss feed. I was able to grab the thumbnail from media:thumbnail using item.thumbnail =jQuery(this).find('media\\:thumbnail, first').attr('url'); However I am now trying to grab the url with the video file and I keep getting undefined here is the excerpt from the rss feed containing the video url: <media:content duration="50" expression="full" isDefault="false" medium="video" type="video/mp4" url="http://test/1/>
Highlighting active link with JS problem
Hi. I found this script which highligts active link based on page id given in body tag (https://www.youtube.com/watch?v=dRLOHxyCaGU). The problem is that i have same named links in couple of sections on my page, so they get highlighted both at some point. BAND -Members GALLERY -Members MULTIMEDIA -Misc FAQ -Misc <body id="Misc"> $("#Misc a:contains('Misc')").parent().addClass('active'); So, is there any way i could give my links seperate id or something so it would be highlighted only in correct
Button's Click with QueryString
Hi, I have: <button id="btnMyStaffLeaves">Leaves</button> in my staff_details.php I want to know how can I redirect when click to staff_leave.php?id=xxxx where xxx is the QueryString ID of the current page (staff_details.php?id=xxx). Thanks, Jassim
Stop an executing function
There's a piece of code that runs as a function called upon key stroke, I want to stop execution of the function on pressing another key stroke both outside and inside of the running function, here's the pseudocode. $(document).on("keydown", function(e){ switch e.key { case "a" : /*run*/ myFunc(); case "b" : /*stop*/ myFunc(); } }) function myFunc(){ Some Loop(){ $(document).keydown(/*stop*/ myFunc()); } } How do I make it stop in both ways, obviously to run doesn't need anything, but calling the
access url iframe after change url
Hello,I want get last url iframe in cross domains, Detail : I load one link to my iframe (till this moment) can get url iframe, But if user click to another link in content iframe and iframe url changed,can not get last URL because error same-origin policy How i can resolve that ?
jQuery Kaspersky issue
Kaspersky insertion is made - as I found out - at places (or 1st place) where "<script" is found. I changed in minimized jquery following to fix this issue: * this: ... replace(/<script(.|\s)*?\/script>/g,"") ... * replaced by: ... replace(/\x3Cscript(.|\s)*?\/script>/g,"") ... I.e. smaller sign by it's hexadecimal escape. For me this fixed Kaspersky injection into jquery.js, that was a really annoying thing (lost few hours...)
Sortable with dynamic containment doesn't reset
In the following jsFiddle, I have a sortable table with some items that must remain in the table and others that can be dragged out (to a connected table - in the real application - omitted here for simplicity). The helper option is set to a function that examines the row as the drag begins and sets the containment option appropriately. For the most part, this works. https://jsfiddle.net/cekyfhvj/1/ Following the instructions above the table, you will see that the "uncontained" rows can initially
Will Jquery affect database?
Is Jquery only affect client's side or Jquery can actually write into database as well?
Function fires as it should not : Is this a matter of propagation ?
Hi, I'm new to jQuery (and JS), I'm discovering the powerfulness of this tool. As I'm a beginner, I still do not understand all the mechanics and behaviours jQuery is based upon. So I'm sorry if this question is a poor one, but I didn't found anything about this. I work on a web app with social parts : users may write posts, answer posts, and like/dislike posts. My question is about the treatment of like/dislike functions. Before, you should know that like/dislike informations for a post are displayed
Making a Json Call
I have a click function that works for one of my anchor tags but I want it to work for two (or more). When I click on the anchor with id get-data-1 it displays the json file microLesson1.json for the div with class quiz-list-1. I want it to display the json file microLesson2.json when I click on the anchor with id get-data-2 as well. <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Test</title> <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
jquery closest() not working to get parent ul
I have a handle the following element as this: <ul class="blog-tags"> <li> demand <i class="fa fa-close"></i> </li> </ul> this.closest('li') returns a reference to the closest li element. but this.closest('ul') returns null. I also tried $(this).closest('ul') which also returns null. I also tried by class name: $(this).closest('.blog-tags') but I'm still not getting a handle to the element. Any idea what might be wrong here?
Multiple div with same class - mouseenter
Hi! I have a document with multiple div's with the same class. The div contains another div that I want to show/hide on mouseenter/mouseleave. Sample html: <div class="node"> <div> content </div> <div class="options"> <ul> <li>Option 1</li> <li>Option 2</li> </ul> </div> </div> <div class="node"> <div> content </div> <div class="options"> <ul>
Copy & Drop instead of Drag & Drop
I refer to http://jsfiddle.net/DKBU9/14/ I want to drag and drop an element from one table to the other but leave a duplication of the original in its place. At the end there should be two similar elements. Is it possible and how? Thx I. Lesher
Next Page