AJAX Code Review
I wrote my first AJAX script that brings content from other pages without refreshing the entire page and i just want to see if improvements can be added to it, or if im doing something not recommended. Thank you. $(function(){ // content container content loader $("#nav-tabs-list a").click(function() { var page = this.hash.substr(1); //$("#sidebar-content-container").html(""); // displays content only after fully loaded $.get("content/" + page + ".php", function(gotHtml) { $("#content-container").html(gotHtml);
Datepicker
I have a question i'm new using datepicker, well using jquery and my question is how can i make that when i click on a dat that can eredirect me to another page? 'cause a isaw in other page but i can understand the code
How to fix Double click button?
Hi guys, I have this button below, the problem is I need to double click it before the form will submit. <?php if($data_completion != FALSE) { //If lesson already taken, disable submit button. ?> <input type="image" name="submitlesson" alt="Submit Lesson" src="<?php echo base_url('images/buttoncomplete1.jpg'); ?>" onmouseover="this.src='<?php echo base_url('images/buttoncomplete2.jpg'); ?>'" onmouseout="this.src='<?php echo base_url('images/buttoncomplete1.jpg'); ?>'" value="submit" disabled> <?php
Images onclick
HI, I have 6 images in a div. I want to navigate to different locations by clicking on each image. $("#divCircle img ").click(function(){ window.open("https://www.irctc.co.in"); }); If I write like this every image onclick is navigating to that site only... Instead of that. I wanna navigate to different locations by clicking on different images. <div id="divCircle"> <div id="middleBubble" style="top: 125px; left: 125px;"> </div> <img src="images/home-laboratory-icon-off.png"
FadeIn / FadeOut
Hi ... I have set up a jquery script that fades in an image and three lines of text. There are two things I want to achieve here and am not succeeding. 1. Stop the loop. I'd like the image and three lines of text to fade in, then out and then stop. 2. After the cycle is complete I would like to redirect to another URL. Here's my code so far: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">
How do i add hash url to this AJAX script?
I want to be able to navigate between my AJAX content using # url so i can send users to a specific page. How can i implement that functionality in this script? $(document).ready(function() { //set your initial pages when website loads $("#content-container").load("content/corporate.php"); // set initial home page $("#sidebar-container #sidebar-content-container").load("content/sidebar-content/poll-faq.php"); // set initial sidebar page // content container load content based on nav tab clicked
.Show method not working with button..
I've fairly fluent in Jquery but why is this .show() to show the Draw button. The deal button disappears fine but the Draw button never appears. Really don't understand why this would be difficult. Also include jsfiddle link below code. HTML <input type="button" id="btnDrawCard" value="Deal"> <input type="button" id="btnReDraw" value="Draw"> jquery $("#btnDrawCard").on("click", function () { $("#btnReDraw").show(); $("#btnDrawCard").hide(); }); css #btnReDraw { visibility:hidden
Chrome is not working with my Jquery photo slider..
I am using Jquery on my front page ( dallasmart.com -- the photo slider).. this page works in Firefox and IE... but it does not in Chrome.... It is not working at all in Chrome.. what am I doing wrong? the following are my includes: <script type="text/javascript" src="../jquery-1.10.2.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script> <script src="http://gsgd.co.uk/sandbox/jquery/easing/jquery.easing.1.3.js"></script> <script src="../slides.min.jquery.js"></script>
Replace text using a drop box.
Hi, I'm looking for a better way, to do the following as displayed in the pic.. $('#monthno').blur(function() { var monthno = $('#monthno').val(); // 2 var racedate = $('#racedate').val(); // 2014-01-26 var dspdate = $('#dspdate').val(); // 18 May 2014 if (monthno == 2) { racedate = racedate.replace('2014-01','2014-02'); racedate = racedate.replace('2014-03','2014-02'); racedate = racedate.replace('2014-04','2014-02');
Navigate AJAX loaded content with link
I want to send users to a specific page in my AJAX loaded content with a url. How can i implement this in the AJAX bellow? $(document).ready(function() { //set your initial pages when website loads $("#content-container").load("content/corporate.php"); // set initial home page $("#sidebar-container #sidebar-content-container").load("content/sidebar-content/poll-faq.php"); // content container load content based on nav tab clicked $("#nav-tabs-list li").click(function() { var page = $("a", this).attr("href");
How do I trigger 'dialog' widget from an area map?
I have created an area map of the US and want to trigger the 'dialog' widget to popup with distributor info for each state via mouse click. Have had no luck so far making it work. Thanks, John
Trouble with .find() and if/else
Hi, I'm trying to use the .find(), to search for a specific DivId inside of another div. <div id="container9"><div id="box9"></div> It sort of works, but I'm having trouble getting the code to run this when I use it in a if/else statement, it loads the entire ifelse statement, instead of just for when the if or else statements are true. Was wondering if anyone could shed some light. Shouldn't it search Container 9 for id"#box9", then execute that code, then break out of the if statement completely?
Set full screen browser
Hi, I wanna set full screen browser when someone visit my website, I know about on click which sets full screen but I couldn't find correct way when my page load. thank you.
Populate textarea with contents of span
Hi, I need to get the text within a span to populate within a textbox. Texarea I would like to populate: <div id="GiftMessageOption" class="top-m btm-m"> <h5>Gift Message</h5> <label for="giftMsg"> <small>Please type your desired message (optional)</small>:<br /> </label> <textarea class="Field validation productAttributeFluidWidth" id="giftMsg" value=""></textarea> <div class="cf"></div> </div> Span I want the
How to accees Elements of Iframe Inside Iframe ?
Hi , I am trying to access Div element which has class(class="box-layout-inner") inside Iframe , But unable to get that element . Here is my Html Code : <iframe src="" scrolling="no" id="ifSubReport" style="overflow: hidden; width: 1062px; height: 1705px;"> <html> </div><head><title></title> <script src="jquery-1.8.0.min.js"></script> </head> <body style="margin: 0px; width: 100%; height: 100%;"> <form name="Form1" method="POST"> <mainbody> <span> <iframe src="" id="iframeMyID" height="650px" width="100%"
Navigate Through AJAX Loaded Content Using URL
I know this has been asked before but i cant seem to get it to work properly despite countless tutorials. I want to be able to use URL's to navigate through AJAX loaded content on the main page. I don't want to use "#", instead the actual page name and use the back and forward browser buttons. Here is the AJAX i use to load my pages. $(document).ready(function() { //set your initial pages when website loads $("#content-container").load("content/corporate.php"); // set initial home page $("#sidebar-container
Using server date inside datepicker
Hello everyone, I have implement datepicker plug-in who works pretty cool, but I found an issue - when someone has wrong date on his computer datepicker also showing wrong date (what is logical). Now I'm trying to use date from server, but I don't know how to "insert" it into datepicker. My code looks like that: JS: $(function () { $.datepicker.setDefaults({ dateFormat: 'dd/mm/yy', dayNamesMin: ['Nie', 'Pon', 'Wt', 'Śr', 'Czw', 'Pt', 'Sob'], dayNames: ['Niedziela','Poniedzialek','Wtorek','Środa','Czwartek','Piątek','Sobota'],
Scroll Page Horizontally With Mouse Wheel.
Hi to everybody, I still need your help because I'd like use mouse wheel to scroll my large html table. My example. http://registroonweb.it/registro/prova.php If there were a lot of rows I cannot see the scrolling bar. Is it possible to to ise mouse wheel for horizontal scrolling. Thanks in advance. Tegatti
Create Array from Variable Values
Hi all, I need to create an array from the output of variable values. (ex. an output returns 5 records). Any clues/examples? Thanks, Kelly
Best way to make a scrolling CSS box
I need to create the following: 1. A DIV with a background in CSS. 2. Then another DIV over the top of the image with an opacity that when clicked, expands out over the image. But, the second DIV must only show a small "Click to Expand" button before it expands. What jQuery would be used to do this?
how can i use two different version of jquery on same page
it does not work together.
.each item in .data storage
Hi all, Is it possible to use an .each statement to iterate through items stored using .data? I iterated through a list and stored the data in a div using .data but would like to retrieve it via an .each Even better, should I write my list output to an array that I could run an .each against. Any help/examples are appreciated! Kelly
jQuery on() doesn't work on loaded inputs (datepicker)
Hi! I have a problem with loaded inputs. The datepicker doesn't show This is my code: $('.datepicker').on('click', function() { $(this).datepicker({ dateFormat: 'yy-mm-dd' }).focus(); }); This code works on the existing input but not on loaded elements. Any suggestion? PS: I'm using codeigniter and twitter bootstrap. Usually this code works but i don't know what's the problem here... Thanks
New line or line break in jquery
please can any one tell me about how to inset new line in jquery as in javascript ' \n '
jquery addclass
Hi All, I have tried various posts from here and google for the answer but to no avail. I need to really simply, change the class on a a list item when it is clicked. It is the nav bar which should have an underline green bar when clicked and hold the class until another is clicked. The page is here http://www.katiesimmsconsulting.com/richard/index.php/welcome it is the orange bar with home, about, plan your tour etc. Any ideas how to accomplish this? Thanks Katie
Help needed for writing to document using jquery
Hai i am completely new to jquery since i am a beginner and want to know to how to write to the document of html using jquery as in javascript document.write() any one can help me
Jquery Check box
Hi friends i m new to jquery. i need to give some limitation for selecting the check box did you have any code for that please help me friends. . .
row to row-fluid with jQuery
Is it a good idea and is it the best way to do that ? I just want to add -fluid to the class row or container if the screen < 1440 onload and on resize and to refresh the page if it is resized under 1440 There is a shortest way to do that I guess $( window ).resize(function() { var width = $(window).width(), height = $(window).height(); if (width < 1440) { $('.container').addClass('container-fluid'); $('.container-fluid').removeClass('container'); $('.row').addClass('row-fluid'); $('.row-fluid').removeClass('row');
Building a photo slider for my site but having issues
Hello, here is the link to the test page: http://dallasmart.com/JQ_TEST/JQ_test.php in the bottom of the page you can see the slider.. I have 6 pics but I can only go back and forth for only 4 pics.. two at a time.. It seems like the left arrow is not firing more then once.. meaning I click on each arrow only once,.. not sure why.. here is he JQ: ( the JQ code is not mine , it is coming from a book... ).. the $wrapper should have all 6 pics but why only 4 are available ? It seems like that once
posting data to a database problem (newbie)
Hi, I'm trying to send data to a database. The data will be generated in a app, which include jquery. Jquery will be used to send the data. I thought it should work like the way I have it now but it doesn't. I have a form and a js in the (html)app. And there is a php file on the server, which adds the data to the database. At least thats what I'm trying to do. When I hit the php-code in my browser, the database will be updated. When I fill in the form for the app, at this moment for testing in my
Generating random number for input value
Hello, I have a numbers only text field and want to assign a random number as it's value. This is the HTML for the field: <div class="productAttributeRow productAttributeConfigurableEntryNumbersOnlyText"> <div class="productAttributeLabel"> <label> <span class="name"> Hidden: </span> </label> </div> <div class="productAttributeValue"> <input type="text" class="Field validation" value="" size="5" /> </div> <div class="cf"></div>
Adding a no conflict in a php file
Hello, I am really hoping you guys can help me with this. I am not exactly javascript and/or jquery savy. I have this code, which I have below. Several people have looked at it, and told me it needs to load jQuery library with no conflict mode. I'm not sure exactly how to do so. So if anyone would not mind taking a look at this code, it's not very long, I would very very very very much so appreciate it. <?php /** * @package $Id: stylepanel.php 6448 2013-01-14 12:32:26Z arifin $ * @version
grep into [object Object] list
Hi, How can i grep / filter into an [object Object] list ? Ive tryed followng code without success. Thanks var cg = {"BE":"Europe","FR":"Europe","MO":"Africa","NG":"Africa"} var arr = $.grep(cg,function(index,value) { return value == 'Europe' });
Anonymous Functions
Hey Guys, I am learning about functions in jQuery, and have a question about anonymous functions. I am just not sure what exactly the purpose of using them, in context with the code. Are they used to get the DOM elements of the page? For example in the code what is the difference between this $( "a" ).click(function() { // this refers to an anchor DOM element }); and this $( "a" ).click(this refers to an anchor DOM element); Thanks for you help in advance!
Hiding input when radio checked not working
Hi, I have this page: <script type="text/javascript"> modalExtra = ''; maxModalHt = ''; $(document).ready(function() { $('select, input[type="checkbox"], input[type="radio"], input[type="file"]').not('.productOptionPickListSwatch input, .productOptionViewRectangle input').uniform(); modalExtra = $('#ModalTitle').outerHeight(true) + $('#ModalButtonRow').outerHeight(true) + 60; maxModalHt = $(window).height() - modalExtra; $('#ModalContent').css('max-height', maxModalHt); }); $('#giftwrapping_all').change(function()
how many img tag into a div
let's say I have <div id="imgs"> <img /> <img /> <img /> <img /> <img /> </div> how can I get 5 (the number of img ? thank you
url and rewriting
Hi I am using jQuery 1.10 to write HTML in that way $('.flex-prev').html('<img class="prev-img" src="/images/arrow-left.png" />'); it works perfectly on localhost and distant server but if I use in .htacess RewriteEngine On RewriteCond "%{HTTP_HOST}" "!^www\." [NC] RewriteCond "%{HTTP_HOST}" "(.*)" RewriteRule "(.*)" "http://www.%1$1" [R=301,L] the images are not found how can I dot it ? thank you
sending data through get
Hi, I was trying to use jquery for processing data. I am sending form data to register_process.php and checking username already exist or not. If it exist i need to ask the user to re-enter user id else register the user. submitHandler: function (form) { var data = $('.register-form').serialize(); $.get( 'register_process.php', data, function(data) { $('#result').html(data); }, 'html' ); }on success this will be executed function(data) { $('#result').html(data); },but what i should send
VERY URGENT : Need Solution For Jquery Conflict (jquery.lightbox-0.5.js and jquery-1.4.4.min.js)
I'm having a critical problem with Jquery. Please check My Link: http://ecoverexpert.com/new-design/ There is 2 section for jquery. 1 = This is Full Width Image Slideshow 2 = This is Light Box. 1 is working but 2 is not working with me. Can you please tell me the solution, How I will work with both Coding? Waiting for your quick response.
Problem with jquery-1.10.2.min.map coding
here i wish to bring to notice that jquery-1.10.2.min.map code report problem of "incorrect token : " in chrome as an error and " use ; before statement " as an error in firefox console....tried to change it but no success please provide soln. to the problem...
Next Page