ajax load into ajax loaded page
we have a page with radio button and div with id=vijegiload (1.php) if click on radio we have ajax load a dropdown list and div with id=vijegiload2 from (2.php) with echo code that load in id=vijegiload in 1.php now we have a dropdownlist and id=vijegiload2 that added in 1.php now how we can load another thing in id=vijegiload2 with ajax post $(document).on('change','[id^=vijegi]',function(){ //radio button id=vijegi if(usr.length >= 1) { $("#vijegiload").html('<img src="loader.gif" align="absmiddle">loading');
Confusing behaviour of .data()
You can read a data-* attribute with .data(): $('body').attr('data-id', 1234); $('body').data('id'); //1234 But when you set it again, it always stores the old value! $('body').attr('data-id', 5678); $('body').data('id') // still 1234 I found out that I used .data() wrong and you are not supposed to do that - but still, the fact that .data() accepts attributes, but only the first time is super confusing and even caused some dumb bug in our code. If you aren't supposed to mix .attr() and .data(),
Storing xml data in the browser so it can be used in the html markup.
I have been tasked with create pages that load data from an xml document. Then use that data in the html markup. I can load the xml but how do I make the data reusable variables? Thanks
show pdf file
Hi all, how can I show a pdf file using jquery ... I just click on some link/ or picture (smaller image of pdf ) ... doesnt matter ... and it show me that file for reading ... something like google has ... i hope you understand what I want :-)
$.getScript with url hash
I'm using Weinre for debugging my jQM app. I'm trying to load the Weinre's script with .getScript() but it's not working since it's removing the hash part of the URL: original: http://192.168.0.4:8080/target/target-script-min.js#bla getScript: http://192.168.0.4:8080/target/target-script-min.js As result, I can't get my debugger env to work. Why getScript is not respecting the entire URL and how can I solve this? Thanks. PS: I need to load dinamically, not from "<script src..." (this way works good).
Can we store custom rules for validationEngine.js in database
Hi friends i am new to jquery i was using validationEngine.js for my Form validation. normally we store custom rules in validationEngine.en.js file instead of those file can we store the custom rules in database.it is possible or not. please help me friends. thanks in advance..
AutoComplete loading XML source Not Working
Hi all and thanks in advance!! Kinda of a Newbie with JavaScript... I had this script working on another server with another xml source but can seem to get this working. What I've done is added 2 more columns to my Data source (XML) as I'm wanting to use the same source on 3 pages just with slightly different outputs. 1. A jQuery search Suggest/Autocomplete 2. A jQuery A to Z list 3. A jQuery Department/Speciality list. Ok the first problem seems to that my data source has 2 more sections in it and
Elements wont be created!
Does anyone know, why this Code does not create any of the elements (<li>, and <ul>)? Thank you! :) var makeTabs = { init: function(){ var $pages = $("div.tabs"); if(!$pages.lenght) return; $pages.addclass("dyn-tabs"); $pages.first().show(); var tabNavigation = $('<ul id="tabs" />') .insertBefore($pages.first()); $pages.each(function(){ var listElement = $("<li />");
Autodivide / create month headers for list of dates
Has anyone any idea on how to complete any of the following using Jquery: Go through a list of dates e.g. <ul> <li>10/07/2014</li> <li>20/07/2014</li> <li>11/08/2014</li> <li>21/08/2014</li> <li>11/09/2014</li> <li>22/09/2014</li> </ul> and automatically add the month headers (July, August, September) to delineate each month in the list. Ideally this would simply add an extra <li>MONTH</li> just before the first date in each month. If this can't be completed after the list has been rendered I've
Ajax Jsonp Cross Domain
Hi, I'm writing the following function to check on an other server if an user in a db exist or not. Unfortunately my function isn't working. I googled a lot but couldn't find an solution. Ofter i read i have to user async:false but i used this from the beginning. Has anyone an idea how i could implement this right? When i to an alert on the end of my function, i'll get a result, otherwise i don't get an return value. thanks function checkuser(id){ var res = ""; $.ajax({
Comparing two arrays to get the union set. no can do
I've got two lists on a page. I want to hide items in one list when items of the same name (text) are found on a second list. I can create the arrays ok but having difficulty understanding how to use the [i] value as a variable when comparing the two arrays. The value "Application to Use Radioactive Materials" is in both arrays but my code cannot discern it. I want to hide the tr for "Application to Use Radioactive Materials" on List one because it is a hidden block of text on List two. But the
Slidetoggle
I'm using the jQuery slidetoggle and I am having trouble keeping the slidetoggle open, what i need is when the slidetoggle is open and there are links within the area and the user selects a link and then hits the browser back button, we need the slidetoggle to remain open, can someone help me write this code?
How to load a div every minute
Hi all, What is wrong the code below, I can't refresh the div I want. function fn60sec() { // runs every 60 sec and runs on init. var pathname = window.location.pathname; $( "#user-card" ).load( pathname + " #user-card"); } fn60sec(); setInterval(fn60sec, 60*1000);
[How to?] how to add a dynamic option like this picture and how it works in database?
how to add a dynamic option like this picture and how it works in database? it created as a field in database? and how to make the effect to add more ?
Jquery Fenster Pop up - How to Close this popup
Hi Team, I have a Div , Inside Which is have form , Along With Submit and Cancel Buttons for the same. I have applied this div a J query Fenster Property and Made it as Pop Up. But When i Click Cancel Button , My Pop up Does not gets Close.
dropdown list and ajax load notifications
i have a dropdown list that if select every item of this dropdown we have a ajax call that load a php file with this begin of ajax call for loading php file $(document).on('change','[id^=vijegi]',function(e){ e.preventDefault(); and php file echo echo'<input id="title" class="onvan" type="input" class="form-control" value='.$postvijegi.' placeholder="Enter a title ..."/> <input id="message" class="pay" type="input" class="form-control" value='.$postvijegi.' placeholder="Enter a title ..."/> <div
click() function in Firefox problem
I am using the following code to hide a form when the window is clicked anywhere, except on the form area itself: $(document).click(function(){ $('#contactForm').fadeOut(1000); }); $('#contactForm').click(function(event){ event.stopPropagation(); }) In chrome everything works smoothly, however in Firefox whenever I right-click anywhere on the page (including on the form), the event click is triggerred and the function fadeOut() is executed. Anyone have any ideas? Kind regards, Orestis
Clickable element in clickable element executes function twice
Hello everyone, I'm having a button inside a div like this: <div id="myDiv">Information here <button id="myButton">More</button></div> <span id="mySpan">even more information here</span> Now I want to slideToggle() a span by clicking either on the button or the whole div. I'm doing this using the following code: $(document).on("click", "#myDiv, #myButton", function(){ // slideToggle-stuff here }); The problem is, that when the user clicks on the div, everything works as expected and the span
Apply a jQuery function to a DOM element from a list of DOM elements
I'm trying to apply a jQuery function .val() or .text() to a DOM element. I get this DOM element from a list of DOM elements like this: $("label")[0] and this: $("label").get(0) and everything is alright, but the problem is when I try to apply a function to this element $("label").get(0).text() or $("label").get(0).val() then I get this error in the console: TypeError: undefined is not a function Shouldn't this work?
working with JSONP
I have this code, var url = "site that I'm going the data" $.ajax({ url: url, contentType : "application/json", dataType: "jsonp", success: function(data){ alert(data); } }); that data is displaying, but I can't display it in the page? any help will do, Thanks.
Need jquery tabs example with url
I can find lots of examples of how to do jquery tabs when all you have in the tab body is latin text. Sometimes you see an example with some html in the tab body. What I haven't found yet is how to specify a url for the text body. That is, how to specify that the tab body is to go out to a url and fetch the html that it needs. My app is an mvc4 application using Razor. I'm sort of new to web development in general, so don't assume I know anything. :)
How do I find the width of a dynamically added select box?
Suppose I have some javascript that adds a select box, and populates it with options - something like: select = document.createElement("select"); select.id = theid; So assume I have filled the listbox with elements, and now I want to know how wide it is. I tried checking $("#" + theid).width(); but that did not work. Is there another way? Thanks.
window resize hover animation
Hello! I'm trying to create a custom responsive accordion menu that animates when you hover over it, but when sized down to mobile, changes to a clickable grid. I think I have the majority of the work done, but cannot seem to nail the window.resize() handler. I feel like I need a way to stop the resize handler from calling, once the if statement is met. But, I'm not a jQuery master, thus I am having trouble figuring out how to properly write the syntax. You can find a link to the example here: http://caseybaggz.com/CB-2.0/sites.php
Slidetoggle for an accordion?
I´ve got 4 catagories (cat 1, cat 2, cat3.....) and i want that all of the categories are shown at the beginning, when i click on a navigation item, all the other gets closed and only the selected one is shown, just like an accordeon and when I deselect the nav item, all categories get shown again. But it doesnt show all the items when i deselect an nav item and how can i give the selected nav item an active class? http://jsfiddle.net/Fz33q/6/
autoresize dynamic html table using jQuery/Javascript ?
Hi, I have a dynamic html table , where last two columns ( textareas) are auto resizable. But I am facing the below issues, The code works fine in jsfiddle but not in browser. Also , when first row textarea expand to a certain length. The next dynamic row that gets added "using add button" also has the same dimension as that of the expanded previous text area. Fiddle demo PS: I don't want to rely on any plugin for this.
Dialog open and close problem
Hi all and Jack, I simplified and minimized my previous question. I have a button on my page like that: <a href="{{ URL::route('category/action', array($category->id)) }} "class="newWindow"><img src="{{ asset('img/green_button.png') }}" /></a> And a dialog div: <div id="diyalog">There is a dialog here. </div> Finally an event: $(document).ready(function(){ $('.newWindow').click(function (event){ event.preventDefault(); $('#diyalog').dialog(); $("#diyalog").dialog("close");
Adding steps and fields and submit to email to SmartWizard
Hi all I found this on the internet: http://techlaboratory.net/smartwizard I would like to create an online application form on a schools website so that parents can enroll their children online at the school. I would like to know how can add steps to it, how to add fields for the user to enter and how to submit the fields to an email in a specific format... As well, how I can set it to not lose any info if the user has not submit the form yet. I have the login and registration page, so the user's
Setting page from code
Hi The pager uses buttons first, prev , next and last Whats the code to do this without the pager? Eric
Feed Database through JSP using AJAX
Hi guys! Please give me a simplest example where an ajax post request is feeding a column in a database, continuously after every 5 second. I am not adding my own code just to avoid confusion. Lets say I wanna send the user's current time after every 5 sec to the database. I am using PostgreSQL 9.1, JSP, JSTL tag library. Hope this is clear. Thx Zia
Responsive boxes with different height
I'm building a portfolio website. The front page will have some box images and they will be responsive. So far I've managed to set them properly with: .block img { float: left; margin: 1%; transition: all 1s ease 0s; width: 24%; } when I resize the window, they are moving great, but when the box images has different height, the space between them is different. Here's a screenshot: http://i62.tinypic.com/2u5urnl.png I want every box image to have a exact space even the height is different
Customise LazyLoad along with fallback for easy implementation. Effective & Functional ?
I use a lot of images in my pages, so i use Lazyload. I create the following tags and it works fine, // <img class="lazy" data-original="http://i4.sdlcdn.com/img/storefront/06/pumaBrandStore_017June2014_01.jpg" alt="Shop Puma Mens Footwear" width="474" height="400" title="Shop Puma Mens Footwear" /> <noscript><img src="http://i4.sdlcdn.com/img/storefront/06/pumaBrandStore_017June2014_01.jpg" alt="Shop Puma Mens Footwear" width="474" height="400" title="Shop Puma Mens Footwear" /></noscript>
Reset selected inputs
Hi all, I need to reset specific (not all) inputs. I am using the following to grab the inputs that have the classes I want to reset, but how would I execute the actual reset of the field. These are numerical inputs with a default value of 0 and I want to reset them to 0. $(document).on('touchstart click', '#reset', function () { var matches = document.querySelectorAll("input.form-control"); alert("got them all"); }); Thanks! K.
Need a little help with accordion menu
Hello, Totaly new in jquery here and I need a little help. So I have one accordion menu which is working but I have to add one function. Now when I click on menu item is open properly but if doesn't close if I click again on the item. For example I have: Item1-head - sub-item1 - sub-item2 I want when I click on item1-head to open and if I click again on item1-head to close. Now only is opening.. Here is the code $(document).ready(function () { $('#nav > li > a').click(function(e){
Conditional Formatting with Jquery
I have found this snippet of code that works great at changing the background of a table cell based on the cells contents <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#LeadList td.LeadStatus:contains('Emailed')").css('background-color','#CCE6FF'); }); </script> ..It looks like its targeting the Div ID and then the table data's class to check if the table cell contains
selector "tagName.className" does not work in the second version ( try in 2.1.0 and 2.1.1 )
or this: $( '<a><b class="ab"></a>' ).find('b.ab'); same problem. it is normal? Or something I do not understand? P.S. in the first version works fine.
Jquery In VB.NET Module
Dear Coders. I am New in Jquery. And I Am Trying To Achieve Some Thing. Below Is My Master Page Code. <%@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits="MasterPage" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Dialog Message Example Page</title> <link type="text/css" href="css/ui-lightness/jquery-ui-1.8.16.custom.css" rel="stylesheet" /> <script type="text/javascript"
[How to?] adding a slow expanding effect on this code
I found this code and it works, but I don't know to expand it with some expandin slow effect, because there's no indication that the code is expanding the table, is that the slideToggle that does the expanding? thanks for your time var $headers = $('.header').click(function () { $(this).find('span').text(function (_, value) { return value == '-' ? '+' : '-' }); $(this).nextUntil('tr.header').slideToggle(100, function () {}); }); http://jsfiddle.net/Zb7h5/52/
Problem Jquery and XML
HI, I am know how I get information about a responseXML using jquery. I can't read the "rs:data" tag. Follow attached xml file. Thanks
Toggle command for Firefox and Explorer troubleshooting
I created a web site for an organization and used a toggle command in jQuery. The link to the page is http://www.jp2mri.org/institute.htm. The toggle switch works well with Safari and Google Chrome, but does not work with Firefox or Explorer. Is there a universal solution to toggle for all browsers?
Animate Without Delay (Pause)
Hi, please try this code : <!DOCTYPE html> <html> <head> <title>Try jQuery Online</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script> <script> $(document).ready(function() { $("#box1").animate({marginTop:"100px",marginLeft:"100px"}); $("#box2").animate({marginTop:"100px"}); $("#box2").animate({marginLeft:"100px"}); }); </script> </head> <body> <div id = "box1" style = "width: 50px; height: 50px;border:1px solid red"> </div> <div id = "box2" style
Next Page