How to submit a form with jquery-ajax and update input on the form?
How to submit this form with jquery-ajax and update ? In my servlet I can put some message as request's atribute or mb is better to put this massage to the response? How to update the <p class = "valid-error" > with jstl or with success function of ajax? This is my code: $(document).ready(function() { $("#mainbutton").click(function() { $("#ajaxform").submit(function(e) { console.log("before"); $.ajax({ url: "userctrl", type: "post", data: $(this).serializeArray(), success: function(data, textStatus,
Stupidtable
Hi I wonder if someone can help please? I have successfully installed stupid table and it sorts when the head of each table is clicked. However I would like the table to sort when loaded on the 10th column ("Points"). Please find the code below and the suggested code below that. Does this code have to be in separate <scripts> or contained, I have tried several combinations without successes. <title>Stupid jQuery table sort</title> <script src="jquery-2.1.4.js"></script> <script src="stupidtable.js"></script>
Why I cannot get action from ajax post request
Here is my code: $(document).ready(function(){ $("#mainbutton").click(function(){ $("#ajaxform").submit(function(e) { $.ajax( { action : "mainbutton", url : "userctrl", type: "post", data : $(this).serializeArray(), success:function(data, textStatus, jqXHR) { alert("success"); }, error: function(jqXHR, textStatus, errorThrown) { alert("error");
understanding design pattern of a jquery gallery plugin
hey guys i was just going through the code of a gallery plugin and i have been on this for a few hours now , basiclly the plugin has the following code structure , have a look : (function( $, undefined ) { /* * Gallery object. */ $.Gallery = function( options, element ) { this.$el = $( element ); this._init( options ); }; $.Gallery.defaults = { current : 0, autoplay : false, interval : 2000
How to scroll to an element inside Div (Jquery & Javascript)
I have a div that surrounds a table. Inside a table there is a span element inisde <td>. In one of the rows, the span element class is "Highlighed". after a button is clicked, I want the scroll bar scrolled to that span element with class "HighLight" The page is filled with old JAvascript methods, so if you can help me with either Javascript or Jquery or both that will be awesome. <div id="DivTasks" style="width: 100%; height: 83px; overflow-y: auto; overflow-x: hidden;"> <table class="blah">
Fade out Div then add display none with fade in delay
Hi all - I'm having a small issue which i need help with. I have a div which has been overlayed over a set of gallery images called ".mask1". When someone hovers over this div i need it to fade out and display none added so i can use the gallery. When the mouse is moved off the gallery i need the div to fade back in after say 2 seconds. i've tried animating opacity with css but obviously the div is still their over the top so the gallery isn't clickable, i've also tried adding a class but the animation
JSON not working pls help
Dear All Please refer http://marathepratishthan.org/register.php JQuery code $('#relationwithmaratheid').change( function () { alert($('#relationwithmaratheid').val()); // display the id when drop down changes which is correctly displayed $.getJSON("relationwithmarathejsonfill.php", {id: $('#relationwithmaratheid').val()}, function(data){ $('#sondiv').text(data['son']); $('#daughterdiv').text(data['daughter']); $('#husbanddiv').text(data['husband']); }); }); The
jQuery slideshow
Hey Everyone I am trying to find a specific gallery style and haven't had any luck. Many are out there on live sites but I can't find any source files to save my life. I am looking for this with the transparent sides/next image preview... http://www.backcountry.com/ Thank you for any help. Sorry if I am in the wrong place.
Beginner with jQuery Mobile and caching - php and url's
Hi all, Just getting started with query mobile on an existing site. All was fine prior to adding query mobile, but now it seems my php multi page login structure is now flawed. Also part of the problem seems to be that generally some page content is showing after clicking links to go to pages - but the url is showing a different page. I think it may have something to do with query mobile caching and other html5 issues....? old php system that might not be the best but did work 1 - login
insert jquery accordion content into the database
Hi I am new to jquery. I have a jquery Accordion on my page with 3 sections. each sction has 3 text boxes. How do i insert data in the text boxes to mysql database?. I am using asp c#, update panel. in my update panel i have modal pop up , inside modal i have a panel and inside panel i have accordion. Any help is appreciated. Thanks in advance.
Frustration with Javascript led me to JQuery
Here is my setup. This link is on Facebook when you are looking in a Group and then it's members. <a class="pam uiBoxLightblue uiMorePagerPrimary" href="/ajax/browser/list/group_members/?id=437856706251061&gid=437856706251061&edge=groups%3Amembers&order=default&view=grid&start=96" rel="async">See More</a> I am using automaton software (ahem...UBot) to perform some administrative type functions on several of the company's group pages. Yes, I know they have a Click command but
I would like to return many values at the same time using jQuery
$('#departement').ready(function () { for (var i = 0; i <= tab.length()-1 ; i++) { return "<option>"+tab[i]"</option>"; }; }).append('select') Greetings, I would need help, because i can't actually do this: My elements are in an Array, and i would like to append them to the <select> tag. And i would also need to know if i am using correctly the .ready() function. Thanks in advance
I have A Dropdown box and Input Box I want one event (blur dropdown or Input box) and do conditional check
Dear All I have A Dropdown box and Input Box I want one event (blur dropdown or Input box) and do conditional check I tried ($("#surnameid"),$("#newsurnamed" )).blur(function() { ..... Also ($("#surnameid") || $("#newsurnamed" )).blur(function() { but works only for $("#surnameid") Indeed we can use separately like $("#surnameid").blur(function() { .....do something here $("#newsurname").blur(function() { .....do something here <tr> <td width="53%" class="text11"> <select name=surnameid id=surnameid>
click instead of hover
hallo, i have a hover function that works and i want to change it with a click function...it does not work with mouseou, why? <script type="text/javascript"> $(document).ready(function(){ $('#div').hover(function(){ $('#div2').fadeIn(1000); $('#div1').fadeOut(1000); },function(){ $('#div2').fadeOut(1000); $('#div1').fadeIn(1000); }) }); </script> changed like this: <script type="text/javascript"> $(document).mousedown(function(){ $('#div').hover(function(){
reducing all js file request to one js file .
hey guys i was just checking my page speed over at google pagespeed here. and came to know that for each js file ofcourse there is an additonal request send , now apart from concatinating all the js files into one to reduce the number of request , is there any other way , plugin etc that can be used to reduce the number of request of all my js files to one request ? is there a way to do that ? i know this question is more appropriate for a webmaster forum , but i taught it would have a js solution
Beginner trying to get first command to work
trying to get this simple .html command to change the text in the button from "it's a button" to "my button" like this guy does in this tutorial https://youtu.be/G-POtu9J-m4?t=24s except it's not working for me. I have jquery-1.11.3 in the same folder that my index.html is in. I don't know what could be wrong. <!doctype html> <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang=""> <![endif]--> <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang=""> <![endif]--> <!--[if
problem on adding a new function
Hello, I am using OpenCart. I added this code to make image of product fly to cart when user click on add to cart button: $('.buttonm').on('click', function () { var cart = $('#cart'); var imgtodrag = $(this).parent('.item').find("img").eq(0); if (imgtodrag) { var imgclone = imgtodrag.clone() .offset({ top: imgtodrag.offset().top, left: imgtodrag.offset().left }) .css({
How to create rollover news section for my website?
Hi guys, I'm trying to find a rollover news for my website http://www.luxotime.com . If you look at the bottom of my homepage there is a news or some articles which updates. I would like to show only 1 row of article but want it automatically scroll or rolling to next article automatically each 30 seconds for e.g. Is it possible to do that with JQuery? A sample code will be appreciated. Thanks in advance.
Return a number instead of an object?
Hello. I am trying to build a price calculator that changes based on when a person chooses a product or increases their quantity. Everything seems to be working, but I'm getting [object Object] instead of numbers. I'm not understanding how to make "return fry;", or "return leela;" give me a number instead of an object. Thanks, jQuery(document).ready(function(){ var qtyCode = jQuery('.qtyswitcher-qty').html(); var price = jQuery('.switcher-pb_product_size .switcher-label').click(function(){
This is the ugliest page I have ever seen! Does anyone care about this forum?
Hi; First of all, I love Jake. I come back here because of him. Incredible dude. But take a look at this login page of the forum ! Are you serious? A drunk 4 year old can do a better design. The buttons are ugly and out of order, in wrong places. I think you should spend few hours and fix the design. The forum is too good to have such an ugly entrance! Cheers
value of text boxed within table tr should not contain same value
if i have <table id=tbl> <tr> <td> <input type=text name=nm1> </td> </tr> <tr> <td> <input type=text name=nm2> </td> </tr> <tr> <td> <input type=text name=nm3> </td> </tr> </table>
need a new st of eyes on this
Hi All, i like another set of eyes on this I can not get this to work Thanks Link to page http://n9mfk.info/newidea/myindex.html Link to code http://n9mfk.info/newidea/js/mydashboard.js Uncaught SyntaxError: Unexpected end of input line 1 mydashboaad,js $(document).ready(function() { }); infiniteLoop(); function infiniteLoop() { var updateTimer; $.ajax({ url: './realtime2.php', dataType: 'json', success: function(data) { function updateTimeout()
How To rotate arrows onclick in menu?
hello, based on this topic (https://forum.jquery.com/topic/creating-a-jquery-mobile-menu-with-toggle-submenus ) I create my menu, but I don’t know how to change arrow from ▼ to ► when its clicked. can someone tell me? edit: online demo added: http://jsfiddle.net/sabeti05/4cp9f056/2/
Using Lazy Load for loading Divs?
Hi, All tutorials bout using Lazyload are talking about loading images. Is there any Lazyload plugin that can be used for loading Divs? Thanks
By first Click; hide an element immediately and by second click show it again after 3 seconds
Hi, I want to achieve that when I click on a button the caption of my slider hides immediately and a second click on the button shows the slider caption after 3 seconds delay. I tries this code: <style>.hide: display:none;</style> ("#hamburger-menu").click(function() { $(".slider .caption").each(function() { var kir = $(this); if( kir.hasClass("hide") ) { setTimeout( "kir.removeClass('hide');",3000 ); } else { kir.addClass("hide"); }
Accessing Id's created by s:iterator
Hi, I have Id's like below: id =" Test_List_0_test1 " id="Test_List_1_test1" id="Test_List_2_test1" Which are generated when I use s:iterator with the List. I want to loop through these Id's in Jquery.. How can I get the handle to these objects/ value. I need to do some validation based on the values
How to avoid the scroll lock?
Hello everyone . I'm trying to create an analogue of this or this plugin. Here is my code : $(window).scroll(function() { if($(this).scrollTop() >= $("#Page_1").offset().top/2){ var scroll_page_2 = $('#Page_2').offset().top; $(document).scrollTop(scroll_page_2); } if($(this).scrollTop() <= $("#Page_1").offset().top/2){ var scroll_page_1 = $('#Page_1').offset().top; $(document).scrollTop(scroll_page_1); } }); I have blocked scrolling . An example is here . Well with my code so everything
Dropdown menu problem
Hii, I am trying to make a navigation bar with bootstrap classes but unable to do this, I want a dropdown menu where I want a sub menu under a button. please help me below is my entire code.. <nav class="navbar navbar-inverse" role="banner"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="sr-only">Toggle
Created jQuery-Mobile site and it works great, but my desktop version is no longer visible
I created jQuery-Mobile site with Dreamweaver and it worked great, but my desktop version is no longer visible. Is there something I need to add to the code? This is the mobile site I created: http://hendrickscountysso.com/mobile.html This is the regular site: http://hendrickscountysso.com/home.html I had to put my regular page back out there because I cannot afford to not have the desktop version unavailable. What do I need to add so my desktop site will show up??? Below is the code for my index.html
what have i missed
What have i done wrong here http://n9mfk.info/newidea/mynow3.html Thanks Beau window.onload = function() { var updateTimer; var cp = ['N', 'NNE', 'NE', 'ENE', 'E', 'ESE', 'SE', 'SSE', 'S', 'SSW', 'SW', 'WSW', 'W', 'WNW', 'NW', 'NNW']; $('[id$=Table]').DataTable({ 'paging': false, 'searching': false, 'info': false, 'ordering': false }); function updateTimeout() { // Change the icon on the last update to show that there has been no update
How can I check if a select dropdown changed
Hi. I am new in jQuery so here it is my question: How can I check if a select dropdown field changed. In a form I have some select dropdown fields, and I need to check if they were changed or not. I think I should use selectedIndex and defaultSelected but don't know exactly how. Could someone give me some tips? Thanks a lot.
Passing ID into function instead of hard code
Hi, I manage to get it works by pressing a button and a value will load into a textbox. Here is my code <asp:TextBox ID="txtResult" runat="server"></asp:TextBox><br /> <input id="btn7" type="button" value="7" onclick="PassInput()" /> and my function is function PassInput() { $.ajax({ type: "POST", url: "VB.aspx/GetInput", data: '{name: "' + $("#btn7")[0].value + '" }', contentType: "application/json; charset=utf-8", dataType: "json",
How to assign a data from $.get to a var, or read the responseText
Hi, I've been looking everywhere for this... I've got this dict in JS - {
ranges: {"year 2013": ["01/01/2013", "31/12/2013"]}
opens: 'left', format: 'dd/MM/yyyy', separator: ' to ', startDate: START_DATE, endDate: END_DATE, minDate: '01/01/2005', maxDate: '31/12/2023',
}Now I'd like ranges to be dynamic and not hard coded so I managed to pull data using this request: $.get("accyears", function(data){data})I obviously can't put the whole thing in a variable as it's an object. Trying to set 'data'
understanding the usage of e inside carasoul.js
hey guys i was just going through the code of carousel.js and i am a little bit confused , now we it comes to attaching events i ofte see code as follows :: $('a').click(fuction(e){ if(e.target.targetNode == $(this)[0]) //do something }); I am still a bit confused , who is passing the e ? WHO really is passing that e inside the function ? also in the plugin code i see things like the below : Carousel.prototype.keydown = function (e) { if (/input|textarea/i.test(e.target.tagName)) return switch (e.which)
create a txt file with ajax and php
Hey everyone, i want to write a Script which creates a txt file with some user entered variables. The communication between the script and my HTML Document with ajax works fine. But i have some problems with the creation of the file. Maybe someone find a small mistake in my script... <?php <!-- SAVE POSTDATA PART--> $content = "test without variables"; $savename = "test.txt"; $file = fopen($savename, "w"); fwrite($file, $content); fclose($file); echo $savename; ?> And the JavaScript Part: $("#mybutton").click(function(){
Newbie here trying to use external javascript
So I was using CDN to use javascript through JQuery in the html, but for organization's sake, I would like to have my javascript externally, but I can't get it to recognize the JQuery anymore when its on an external file. Can anybody let me know how to use CDN for Jquery and have Jquery/javascript in an external file? Thanks!
Click function for map marker syntax
I'm writing a script to call a unique bootstrap modal depending on which map marker is clicked on a google map. I can't get the modal to launch within my click event of the for loop. If I write a click event for each marker independently it works fine, but I don't want to write 50 click events... I know its how I'm writing the click event thats the problem, I just don't know how to write it properly. var map; var mapOptions = { zoom: 8, center: new google.maps.LatLng(43.819201,-79.535474),
jquery-1.4.5.min.js referred in the template site is missing
Hi Where can the file jquery-1.4.5.min.js be obtained? It is not available here: http://code.jquery.com/jquery-1.4.5.min.js
Unable to make imports to work
Hello all. I am creating a small form based in a given json, but my dynamic imports are not working properly, it add only after the function is called causing a function to not be found. In order to make this import I did this small function: function include(scriptName){ var head = document.getElementsByTagName('head')[0]; script = document.createElement('script'); script.src = scriptName; script.type = 'text/javascript'; head.appendChild(script); } It works as it should,
open page from link
hy. I have a site with index.html where it's a div content where i change contents with ajax calling to files that are into a folder called contents. All is right, but when I link the url the browser open the page in the folder but not the structure of index page. Anyone could help me?
Next Page