Adding content with jQuery
Hi I've been given the following code (from a book on jQuery) that should add content to the page: $('<div>', { id: 'specialButton', text: 'Click Me!', click: function(){ alert("Advanced jQuery!") } }).insertBefore('#disclaimer'); The problem is that is doesn't seem to work - I don't see any text and when I check the DOM or when I inspect the page using Chrome's tools for doing this I don't see any error messages in the console but neither do I see the div added to the page.
JQuery Mobile Submission Form Questions
First let me preface this by saying I'm new to JQuery Mobile and still trying to figure it out. My issue is I have created a submission form and I have a few questions: 1. How do I make certain fields mandatory? 2. I have it set up so that the user selects who they want to send the form to from a drop down menu using the following example of code. Is this correct? <label for="select-choice-0" class="select">Select:</label> <select name="select-choice-0" id="select-choice-1"> <option value="none"></option>
Please explain this IIFE?
hi Have a look at this code : <script> (function ( $ ) { var shade = "#556b2f"; $.fn.greenify = function() { this.css( "color", shade ); return this; }; }( jQuery )); </script> <body> <span id ="id1">Enter Your name</span> <br /> <p id = "x">BYE</a> </body> IIFE return in red does not have any effect on any element in <body> tag.So what is the use of IIFE here? Can't we make "this function" instead of IIFE? What exactly "this" in IIFE refers to? Waiting for your response!!!!! Regards Varun
handsontable is not displaying in UI?
Hi All i am using the below code but handsontable is not displaying anybody has idea. <?xml version='1.0' encoding='UTF-8'?> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:f="http://java.sun.com/jsf/core" xmlns:af="http://xmlns.oracle.com/adf/faces/rich"> <jsp:directive.page contentType="text/html;charset=UTF-8"/> <f:view> <af:document id="d1"> <af:resource type="javascript" source="jquery.min.js"/> <af:resource type="javascript" source="jquery-1.10.2.js"/>
Problem with return value from JQuery call
I have a JQuery script which calls a PHP file (should it be a PHP function instead?) The script only shows the "not working"-alert box, and alert(output) displays nothing. The PHP file can return only 2 values, ('1' or '0') This is my JQuery code: <script src="http://code.jquery.com/jquery-1.11.1.min.js"></script> <script> function checkCountry(country) { $.ajax( { url: 'ajax/getCountryState.php', data: {country: '1'},
offset Line
What is the 4th Line really doing var posY = offset.top - $(window).scrollTop(); <script type="text/javascript"> function show() { var offset = $(".logo").offset(); var posY = offset.top - $(window).scrollTop(); if(posY <=-80){ $(".navbar-brand").css("display", "inline"); }else{ $(".navbar-brand").css("display", "none"); } } show(); $(window).scroll(show); </script>
$(document).ready() is not working after coming back from a page
Dear All, I am developing an application in asp.net using c#. In my page I have done ajax call to load the page with html. The html code is coming from the database. This ajax call is written in the document.ready() function. When I am first time loading the page its working fine. When I am going to another page, that is also working fine. But when I am trying to coming back from that page then the document.ready() is not working. For that reason the html code is also not getting populated. How can
New to jQuery. Having a recursion issue.
Alright, I'm fairly new to jQuery, and what I'm asking for may not even be possible. I have a very small XML file that looks like this: <?xml version="1.0" encoding="utf-8" ?> <BookList> <Book> <Title>Book One</Title> <Publisher>Just A Test</Publisher> </Book> <Book> <Title>Book Two</Title> <Publisher>Some Other Book</Publisher> </Book> </BookList> Just something simple, as proof of concept. And this is the jQuery I'm using. <!DOCTYPE> <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
Inserting widget Themeroller into Dreamweaver CS6
Hello, I have tried for ages reading the forums and "getting started" page but nowhere can I find simple step by step instructions on how to insert the new awesome themeroller widgets .zip into my dreamweaver CS6 site. I've tried various different methods but I cant get it to work at all. Before in DW I would install widgets (like the jQuery tabs widget from 2012) into the "install widget browser" and upload the .zip file from there, but DW has disabled this in an update to try & force people to
Javascript to format Arduino code
I will be upfront about this: I have asked this question on several other forums but have had no usefull replies so I thought that I would try here where you specialise in javascript and jquery.I am trying to implement some keyword colour formatting used in Arduino micro controller code. I used Javascript’s to apply the relevant classes to the keywords but as you can see here http://jsfiddle.net/5xuER/embedded/result/ the scripts obviously enough changed the text colour of all of the full or partial
Function Call
function show() { var offset = $("#child").offset(); var posY = offset.top - $(window).scrollTop(); var posX = offset.left - $(window).scrollLeft(); $("#output").html("top:" + posY + ", left:" + posX); } show(); $(window).scroll(show); Well I understand that $(window).scroll(show); means that execute the code when the window starts scrolling , but than why is that thing show(); In the code , i don't get its relevance , what is it really doing ?
Will Disabling the Tab key on textboxes cause any issue with data?
Hi All, Recently I added a script to my page to prevent the user from tabbing through certain textboxes. Here is the script That I wrote: My question is, is this safe? I ask because, I have a text box that is getting the cost of a service for a record, and when I look in my database, the cost has been inserted into all records??? I checked my back end and everything looks fine. Can anyone break this script down and tell me exactly what it is doing? Thank you so much. I put this script together from
Using jquery impromptu with c#
Hello, I'm just starting to use jquery for the first time and I'm having a hard time figuring out how to get the value from a user selection prompt to my server side code. I've created a hidden field, but I'm not sure how to set this value in jquery. Here is my code <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script type="text/javascript" src="jquery-1.11.1.min.js"></script> <script type="text/javascript" src="jquery-impromptu.min.js"></script>
json, ajax and php. Making it wok together
Hi. I downloaded and adapted an Ajax and PHP based Contact Form, to match my form and my purpose. The downloaded file works the way I want, but the changed file doesn't. I can't find what is wrong. Can some one help me finding the problem? Here is my code index.html <!DOCTYPE html> <html> <head> <title>Formulário de Registo</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $("#submit_reg_form").click(function()
Where can I find instructions on using jQuery validation with asp.net formviews and gridviews?
Where can I find instructions on using jQuery validation with asp.net formviews and gridviews? I've been hunting around the physical bookstores and Google searches and have not been able to find anything relevant. All the instructions I have been able to find assume that I'm working with simple tables, and not formviews and gridviews, which are a different beast entirely. I've been using asp.net server side validation, but I kept reading about how if I used jQuery validation, I'd never go back. That
how can we write jquery only for apple OS X Snow Leopard with some css ?
Hi all, I use some jquery for a simple height maintain for all width resolution. but in this particular operating system of apple that is not working after 1600*1200px. please give me any idea for fix it . this is my script which i am using in page. $(document).ready(function () { $(window).resize(function () { var current_height = $('.home_slider').height(); var mgbottom = ""; if (current_height >= 300) { mgbottom = (current_height - 300) + 15; } else {
Get timezone from address
Hello, I use this code for auto-completing address. Can someone help populate a hidden field with the time zone of that address when address is selected? Thanks JAke
Making divs or HTML input controls read-only
I have a problem trying to make an entire div or individual HTML input controls on the div read only. I have a div that looks like to included HTML code and I late call a JavaScript function which runs the included jQuery statements, but it does not work. Does anyone have ideas. <!-- from "benefits_application_page.htm" --> <!-- start: divReadOnlyFields --> <div id="divReadOnlyFields "> Last Name: <input name="last_name" type="text" id = "last_name" required/><label id="Label4"> Other Names:</label>
Stop on final slide
Hi there I have 28 slides in total but I need it to stop on the final one Can someone give me the script for this... Thankyou
JQuery add/remove class?
So I have been creating a simple coming soon page for a site. One of the things I want to be possible id that the form button changes class (colour and background image essentially). These scripts that it uses being process.php do work and I have validated that with the end collection of the emails once they have been put correctly into the form. I can say that all of the JQuery works up until the point where the user errors the form first and then gets a successful entering of the email. Heres my
jquery hover any element changes img in one element
I really cannot see why this shouldnt work, comments please? <head> <script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script> <script> $document.ready(function(){ $('.doit').hover(function(){ $('#cy > img').attr('src', '/images/7.png'); }); }); </script> </head> <body> <div id="tasc" class="doit"><a href=""><img src="/images/1.jpg" alt="tasc"/></a></div> <div id="dsc" class="doit"><a href=""><img
Ajax Loading Bar?
$(document).ready(function() { $("select[name='month']").change(function() { var infom = $("select[name='month']").val(); $.ajax({ url: "documents/getinfo", type: "POST", data: "infom=" + infom, success: function(likeResult) { $("#likeResult").html(likeResult).fadeIn("slow"); } }); }); }); I have image
Generate divs with jQuery
hey guys i need your help i want to make a div generator. so when i write a number in the input field and press the button, the divs should generate. so thats my html <div id="tileContainer"> </div> <input type="textbox" value="3" id="generatetile"> <input type="button" id="tiles" value="generate"> thats my js $(document).ready(function(){ var x = $("#generatetile").val(); for(var i=0; i< x ; i++){ $("#tileContainer").append("<div class='tile'></div>"); } }); my css
Target select tag and run script on change not working
Hey there people I am this piece of HTML code in my view <div class="form__item-container editor-wrapper listbox multi-selector label-inline column-two"> <div class="editor-label"><label for="JobTypeIds">Job type</label></div><div class="editor-field listbox"><select id="JobTypeIds" multiple="multiple" name="JobTypeIds" style="display: none;"> <option value="6509063">Perm</option> <option value="8249162">Temp Shift</option> <option value="8249163">Temp Regular</option> <option
New to jQuery - need a little help with a news page
Hi, I'm a Flash developer who is now giving jQuery a go (as Flash days seem to be over). I'm trying to create a news page with this plugin: http://malsup.com/jquery/cycle/lite/ I've got all the slides working okay which I'm using for the news item headers or titles. When the header is clicked I would like the news item details displayed e.g. full text with an image. I've managed to created an event for the click (of the header) but I'm not sure how to link the news header/title etc. to the news item
Spot the error!
Hi all, Been working on this piece of code for about 4 hours now, can't get it to work! I genuinely don't know why - I've been looking at it and have no idea what's wrong. Have been stubbornly trying not to ask for help, but now I give up. Can anyone see the problem in this code: $(function () { $('.multi').click(function(){ $(this).closest('.full-width') .after('<div class="row full-width"> <div class="triangle"> </div> <div class="gridfix"> <div class="medium-12 columns section center"> <h1> What
Why setTimeout() is not working with empty function
This one is waiting for 3 secs. setTimeout(function(){alert("Hello")}, 3000); But if i try like this it is not at all waiting: setTimeout(function(){}, 3000); alert("Hello"); My question is Why setTimeout() is not working with empty function?
Click on (some Cells) generated dynamically by php mySQL not working
Dear All I Click on some cells generated dynamically by php mySQL not working $('#containerworkdiv').on( "click", "[id^='pp']", function() { var thisid=this.id; var dima=thisid.split('pp'); var actualid = dima[1] ; var url = 'printproductionfill.php' var data = { id: actualid } $('#printproductionworkarea').text("Lading.........."); $('#printproductionworkarea').load(url, data); }); This script works fine for id's = pp8 onwords There is no response
Map div where div don't have certain class
Hi all,is it possible to map div that doesn't have certain class.i'm using isotope filter and range slider.what i would like to achieve is to map isotope item children data attribute which isotope item doesn't have isotope-hidden class.thanks in advance.
Difference jquery
Hi i am new in jquery. i know js,css and HTML here i want to know how many type are there in jquery. do i want to use same every where? jquery-1.11.0.min.js jquery-1.3.2.js what is the different these two? any more is there? Thank you
Animation only works on refresh.
Hi there, I've made a simple animation of a cannon shooting a ball chosen by the user. Basically, I want my user to be able to drag the ball to the cannon, drag the lid over the ball, and have an animation play. I've got it so that it works most of the time, but on (what seems to be random) occasions the animation won't play. What's really strange is that if you select the blue ball the animation wont trigger on the first open of the site, but does just fine after you refresh the page. I've got
use .load with .before?
OK, so jQuery is making more and more sense with everyday. I'm using it with more confidence and experiencing less errors, and needing to pop my head up in this forum less often. But today I've found something I need a bit of help with, and I'd be very grateful for a bit of wisdom: I have a long string of html that I want to insert with the .before function. It works, but only if I put all the html on one line, which makes for some pretty ugly code, which is a real pain to edit. I'd like to be able
validation page error show .
In my form validation I use captcha , ask question to user and email validation. I use jquery it work 100% but error messsage is displayed more then one .for every validation. If i press 5 time submit button then the error message is five time show in continuese. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script type="text/javascript" src="<?php echo base_url(); ?>js/jquery.validate.js"></script> <script> $(document).one( "click", function(event){
Need Help Creating a Scroller
Hi all, I am trying to find a jquery scrolling text tutorial just like the example http://s530207904.initial-website.com/ it's the testimonial bar on the left side of the "critical characteristics" so i would like for someone to point me in the right direction on how I can do it. Thanks.
Fire event without change
I'm trying to fire an event without change happening and I'm having some trouble figuring it out. I have the Kendo UI widget on my webpage and the default value is #000000 when the color picker loads. If I click the Apply button in the color picker the 'change' event doesn't fire because I didn't change anything. If I change the slider and click 'Apply' then the value changes and is also put into the 'input text' field. How do I get it so the value #000000 is set when I click Apply without changing
Bottom
Hello dear gurus, I’m very very new in jquery world and need your help. I have a list with jquery tmpl defined in HTML. In javascript rendering all data from data base and obtaining my list values. Now I need to define a toolbar bellow these list but need to show this toolbar only in bottom side. Currently my toolbar repeats when the list data is more than 1. Below is my example. <script id="tmpl-my_list" type="text/x-jquery-tmpl"> <div some style here> //main div <div>value1</div> <div>value2</div>
How to replace iframe embeded urls with ajax?
I'm considering replacing my iframe embeds with ajax calls, however before doing this i would need to know how to prevent links from being followed by the master page. In essence i would like the behavior of an iframe without the hassle of an iframe. Back-story: I've integrated moodle and joomla. Joomla is the master page and currently runs moodle within it using an iframe but i am told ajax can do this better. So far i have this: $('#contents').load('url); It works but the links are followed by
Really basic question - what does the code do exactley?
Hi, can somebody advise what the following code actually does please? Is this refereed to as binding? jQuery('#ilightbox').iLightBox(); The reason i ask is because im trying to run the code from within an iframe. Something like: jQuery('#ilightbox').parent.iLightBox(); Cheers,
Replacing Cycle pager numbers with titles
Hi, I am trying to replace the pager numbers that get generated from jQuery Cycle and use a text list instead. And, further, how to target it to style it. If anyone can provide info/code clues that would be great. Here's what I have so far: $('#slideshow').cycle({ slides: "div.pane", fx: 'scrollHorz', speed: 300, timeout: 0, prev: '#prev', next: '#next' , pager: "ul.tabs" }); I tried the PagerBuilder
Kudos voting system problem
Hi, I have found this simple and cute rating system which I will be using as a voting system for an image gallery. http://webscripts.softpedia.com/scriptDownload/Kudos-Masukomi-Download-79158.html It is very easy to stile and seems to be pretty straight forward. However I am finding it very difficult when multiple Kudos are on the page as they do not work individually. It rates all the kudos at the same time. I will be so thankful to anyone who can offer some help! Many thanks, Isaac
Next Page