How to use the value of an array as value of an attribute?
Hello wizkids/ wizman of this forum, I was wondering if I could use the vallue of an array as value for an attribute. var docus = ["#docu1", "#docu2", "#docu3", "#docu4", "#docu5", "#docu6", "#docu7", "#docu8"]; var spots = ["100%", "300%", "600%", "600%", "600%", "700%", "800%", "900%"]; for (var i = 0; i < docus.length; i++){ docus[i].css({ left: spots[i] }); } I have multiple pages and although I innitially wanted to make a function to add or subtract 100% of the left values. People on this website
Multiple pictures upload jquery.
Hey All, I have working code for uploading a single picture, i want to change this to multiple pictures. I am having some trouble adjusting my code to get the information from all the files. How can i achieve this. I have this code. <input id=\"file-input\" type=\"file\" multiple> <div id=\"preview\"></div> <div> <button class='toevoegen' onclick='uploadpic();'> toevoegen </button> <button > Annuleren </button></div> function uploadpic(){ var data = [] var data = new FormData();
How to update page using jquery, if form action is successful?
I have a question about how to use jquery to update a page, if a form action is successful. Essentially, I am making a new page with a really simple form (name, email address, and comments boxes). I have made a real basic PHP file to call with the 'action=' attribute on the form. The php file does the job and sends me an email (if everything passed to it checks out). Here is where things get... interesting. I want to have it: 1. Not reload the page when the form is submitted. Instead, just update
Registering if functions have happened
Please help me! I am super frustrated right now. I have been online for hours looking through forums but nothing works. I have checked my code 50 times and I have no faults except for some variables not yet used. I am trying to make a multimedia story where I want to make a path through the story using jquery. I have set up functions stating where divs should be on the page when that function is called. The problem is that I have to check which parts of the story have been visited and stupid code
Can I Pass a Resource through Function? OR Can I Send Various Variables to Another Function as a Resource?
I am not an experienced developer with JQuery/Javascript. Currently I am having an issue maintaining same contents through out various processes without querying database again and again. With JQuery/Javascript, I am sure this is easy although I do not know the best way of doing it. Below is an example of what I want: //SCRIPT 1 //......Get some data from database eg: var fname = "Donald"; var lname = "Trump"; var user_id = 1; var address = "White House"; resource = fname, lname, user_id, address;
Triggering Click event in .aspx page
New to JQuery and trying to create some functionality. I have a Visual Studio 2008 project. I have two buttons. I need the click event to fire one of two buttons based on whether either of them is visible when the enter key is pressed. The buttons are not visible by default. I have code that shows or hides them based on user options. I need to add an if statement that will account for whether one or the other is visible. I do have a text box so maybe attach this to the focus of the text box so if
cookies
I have a JSON.parse(Cookies.get and a Cookies.set within an onclick function. I also have a JSON.parse(Cookies.get for the same cookie in a different onclick function. If I do the first onclick then the second onclick on the same page the second one isn't picking up the new version of the cookie unless the page is refreshed. Is there a way of forcing the second JSON.parse(Cookies.get to pick up the new version of the cookie without a page refresh? Thanks
Hot to properly use cache in jQuery
Hello. I'm trying to understand how to properly use caching in jQuery. I have a few cases. Case A: $('.element').fadeIn(); $('.element.active').fadeOut(); I'm assigning element to a variable. How to add class 'active' to this variable? Case B: $('.element').fadeIn(); $('.element > .child').fadeIn(); How to use .find() method to select direct child of the element? Case C: $('.element').fadeIn(); $('.element, .other-element').fadeIn(); How to add other element separated by comas to a variable?
add commas to number without typing in field
I have five text fields on a page. Numbers are entered into the first four and the fifth displays the total. Is there any way using jquery to format the number in this fifth textfield with commas? The first four fields are formatted fine using the code below. Of course this is not work on my jsfiddle. I hate it when that happens but am not worries about that. My main question is, is there a way to use jquery to format a textfield with numbers using commas, where the number is dynamically generated
Jquery Ajax Post Limits
I am trying to post a html page which has a content length of 1842451, not sure if this in bytes. I get a 504 error. I set the maxAllowedContentLength to 1572864000 bytes and the maxRequestLenght to 1572864. I even set this in my webconfig <add key="aspnet:MaxJsonDeserializerMembers" value="10000000" /> But still I am getting the 504 error. Is there a limit that JQuery Ajax can post, as my request never hits my webservices. I am using NancyFX. How do I get this to work?
Ideas for a demo JQuery application?
Can somebody give me some ideas for application which I could develop on my own and demonstrate it when I apply for a job? Of course I should be using JQuery. I could also use server side PHP with Openshift set up.
validation
Dear Sir I did validation for first name in my project, But in the same form if I am validating to last name the validation is not performing well it is only focussing to that last name field. Any one can guess me how to do this and the following code is here " <script> $(document).ready(function(){ $("button").click(function(e){ //validating firstname var firstname = $("#fname").val(); var regfname = /^[a-zA-Z]+$/; if(!firstname.match(regfname) || firstname.length==0){ $("#fname_validation").show();
Translate to jQuery ?
I was wondering if it's possible to translate this to jQuery ?
upload photo using $.ajax
my target is upload an image on server directly without submit button and in the same time show the preview. my html: <form id='userPhoto' name='userPhoto' method="post" enctype="multipart/form-data"> <div class="profile-info"> <div class="profile-photo"> <div class="image-upload"> <div class="image-upload"> <label for="fileToUpload"> <img id='image' src="{{url('assets/globals/img/faces/9.jpg')}}"
Sending post data and file data in the same ajax request
Hello, everyone! I'm currently experiencing a problem where I don't know how to send text data via post and files. Here is my code: $(".form").submit(function(e) { e.preventDefault(); // avoid to execute the actual submit of the form. var url = $(this).attr("action"); // the script where you handle the form input. $.ajax({ type: "POST", url: url, data: $("#form").serialize(), // serializes the form's elements. success: function(data)
Error in documentation for jQuery.map
In the callback passed to the .map function the first parameter is the index not the element.
JQuery documentation offline?
I would like to have JQuery documentation off-line. Could I download it from somewhere?
Changing a select option with jquery
I'm changing a select element from another select element with jquery, the code works perfectly once but doesn't after that. Basically it's a simple, change a select option, if one particular value is selected change a different select option (to select one particular option and disable that field). From the second time onwards the field still disables, but it doesn't select the desired option. What am I missing here? $("#<portlet:namespace />orderType").change(function() { var orderVar = $( "#<portlet:namespace
I want to cancel or remove http://code.jquery.com/jquery-migrate-1.1.1.js in HTML
Help me. This is annoying, I always got an error when I access my site. There always show a warning in the console about Jquery Migrate and I really want to remove this. When I take a look at my HTML code, there was no jquery migrate so I confused of how to remove this. Please help. JQMIGRATE: Logging is active (index):588 Uncaught TypeError: $(...).tabs is not a function
Help with on click on mobile <select> tag
https://youtu.be/0eTAQTmgTC0 This is my problem with the website I am working on for inventory of Magic cards. I don't want mobile users to have to click on the option they want twice to get the data to load. If you watch the video you can see what I mean. Here is my code below. <!doctype html> <html lang="en"> <head> <title> Magic Inventory </title> <meta charset="utf-8"> <link rel="stylesheet" type="text/css" href="css/table.css"> <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
Issue with JSON & Ajax request
Hi! I try to get some data from one of those APIs out there.. What I can see in the documentation, this should be written something like the code below. I got the data back in Postman, using the URL (with my own api Key), but in google chrome I just 'error ' got Unexpected token : and {"StatusCode":0," - btw, not sure what I should place in the headers..? Any one that could guide me here? Thanks in advance! $(function(){ $.ajax({ async: true, dataType: 'json', crossDomain:
can anybody help please?
i have a drop down of companies i.e (kipg-1,kipg-2,kipg-3,kipg-4) and i have used onchange event to access the id of companies. and i have a textbox which will always be opened when trademark is selected. question is if user type something in textbox it should show a list of trademark of kipg-1,kipg-2 respectively.but this can only be done when id of selected company is passed in keyup even. how to do that? thanks in advance
Adding li containing divs to an <ol> in a form
I'm creating a "document library" of sorts for my car club. The flex layout appears to be working. I've got a jQuery add function to "add"/insert several form fields in divs to a new <li> that gets added to the <ol> named #sortList using .append(). The new <li> with its divs and form fields appears to be created and added as desired. However, if I submit the form the input type file array named pic doesn't appear to get submitted. Here's my add function: function add() //--- add row <li> to
Bootgrid in laravel
How to use bootgrid in laravel for fitering the data on the basis of date range
jQuery slidedown menu not closing correctly
Hi, I am building a site and am using a full overlay navigation and some jQuery. It works pretty good, however I have one problem. When you close the menu, it seems as if the mask (the grey background) disappears quicker than the text, making it look weird. Any ideas? I'm guessing that is has something to do with .slideUp()/.slideDown() operation. But not completely sure, and not sure what to edit. The navgation was originally taken from https://github.com/adtile/fixed-nav . The js is unchanged,
How to make loaded html document use only it's own css stylesheet?
Hi, I have a navigation bar on the left and when I click one of its buttons it loads another html doc in a div on the right. The problem is that the loaded document uses the main css file from index.html and I only want it to use another sub.css file for example. Is there anyway to make it use only the linked sub.css file or do I just have to add lots of additional classes on the main.css file? Here's the function: $("a").click(function () { event.stopPropagation(); event.preventDefault();
Displaying different image after the page reloads
Hi Guys, How can I display different images after the page reloads? (The images have to be editable at the front end). I was thinking using the jQuery Cycle plugin and have set up the following code,however it doesn`t always displays a new image when I refresh the page. I was trying to add the random function, but I don`t think is correct. Here is my code so far: - how can I set this so it doesn`t fades every now and then, only when I refresh the page. Many thanks! <!DOCTYPE html> <html> <head> <title>JQuery
Can not put a variable of a txt file with tag html in a text element svg
Hi, I want to retrieve the text part between tag html from the load command. For this I use an svg file directly in my html page and the load command of jquery. If I download from a text file without html tag it works well: $ ("# DivA"). Load ("demo_test1.txt"); If I download from a file containing html tags this does not work. $ ("# DivA") load ("demo_test.txt # p2"); A remark in my example the "div" works in both casesBelow my file: demo_test.txt: ***************** <p id="p1" >It works fine</p>
hy parseerror?
Hi, Why I am getting parseerror when I am not returning anything and I am just INSERTing? here is the code: $('#frmSurvey').submit(function (event) { event.preventDefault(); viewModel.loadPanelVisible(true); var formData = new FormData(); formData.append("customer_name", $("#txtName").dxTextBox('option', 'value')); formData.append("customer_email", $("#txtEmail").dxTextBox('option', 'value')); // formData.append("customer_birthday", $("#dateBirthday").dxDateBox('option',
Syntax Highlighter Problem?
SyntaxHighlighter is not defined... $(function(){ SyntaxHighlighter.Highlighter.all(); }); $(window).load(function(){ $('.flexslider').flexslider({ animation: "fade", controlNav: false, start: function(slider){ $('body').removeClass('loading'); } }); }); This code is right? please help me with this...
if element has an image, wrap it and move it
I have a series of divs that may or may not contain an image. I need to check if each div has an image, and if it does, wrap the div, wrap the image, and move the wrapped image into the newly wrapped div (so I can have it float next to the original div). So from this: <div class="event">image text</div> <div class="event">text</div> to this: <div class="eventHolder" > <div class="imageHolder" >image></div> <div class="event" >text</div> </div> <div class="event">text</div> I feel like I'm close
convert json object with spaces
Hi! I have some JSON to deal with. The given structure i have is like this. ... "days": [ { "date": "2017-01-01", "weekday": "Sunday", "workfree day": "Yes", }, ... What I try to do is to use jQuery and Ajax to get an output of some of the values onto a web page.It works fine with for example: var test1 = data.dagar[dayNr].date; (works fine) But.. One of the nodes have a blankspace: workfree day" - I haven't figured out how to solve that in my output.. var test2 = data.dagar[dayNr].workfree
jquery html need help
$(document).ready(function(){ $(".iconClass").click(function(){ $("#iconSearch").html("<div class=\"btn-group\"><input type=\"search\" id=\"searchInput\"/><span id=\"searchClear\" class=\"glyphicon glyphicon-remove-circle\"></span></div>"); }); $("#searchClear").click(function(){ $("#searchInput").val(''); }); }); HTML CODE <div id="iconSearch"> <i class="fa fa-2x fa-search iconClass"></i> <!--Text --> <div id="desText"> <p>Click search icon</p> </div> </div> When I run this code
Supplying a Radix
PARSEINT REQUIRES A RADIX: Please make sure you are supplying a radix for all parseInt(). How can i solve this with this code? please help me... // Fun Facts function count($this){ var current = parseInt($this.html(), 10); current = current + 1; /* Where 50 is increment */ $this.html(++current); if(current > $this.data('count')){ $this.html($this.data('count')); } else { setTimeout(function(){count($this)}, 50); } } $(".stat-count").each(function() { $(this).data('count', parseInt($(this).html(),
Creating single page, parallax style sites best practises
Hello, I'm getting more into front-end development, having been a PHP developer for a while, and am having a go at creating single page, parallax style sites. I was wondering what the current best standard / practise is for this For reference the kinds of affects I'm trying to emulate are similar to http://www.flyjetedge.com/ Thanks for any help.
Jquery show method ?
I am trying to using the div named hid , I have used the form statements in the div and I have hidden the div tag using css and I have used a button when I click the button then hidden div element should be shown, But I am not able to show the result after clicking on the button element too . can any one help me in finding the solution for the answer. <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport"
image of which gallery was clicked
I have two divs each has a gallery class the first one have a few images and the second has a few images to get a click event of an image $('.gallery img').click(); how do I know if it is an image of the first gallery or of the second gallery?
Select row and column of a table.
Hi, in a loop I have to select the 4th td of a table. I've used this: var id = $('#miaTabella tr:eq(1) td:eq(4)').html() it works, but I use always the 2nd row. How can I change tr:eq(1) with the index of the loop? Some thing like this: for(i=0;i<10;i++) var id = $('#miaTabella tr:eq(i) td:eq(4)').html() Thanks in advance Tegatti
Why does "closest()" not work (here)?
Lets start with a sample page: http://www.thewindowsclub.com/winguard-pro-password-protect I want to get rid of the two lines inside the article which start with "RECOMMENDED:" Therefore I coded: $("RECOMMENDED:").closest("div").remove(); but this does not work. The command was told me to delete (only) the next <div> element above a certain string (here: "RECOMMENDED:") Whats wrong? Peter
Delete value from select menu option from saved record
Hello, I think I'm missing something obvious. In my jsfiddle, when Radio Option 1 is clicked , the two drop down menu fields are required. When Radio Option 2 is clicked, the two drop down menus are hidden and their values, if any were selected, are removed. This works fine. My problem occurs when I edit a record. If I had clicked Radio Option 1 and then two options from the select menus; if I go back and edit the record and choose Radio Option 2, while the select options are removed in the form,
Next Page