validation of code
I am trying to pass a string to a jsp file, and then I hope the jsp file will do something with the string. I don't know jsp though. I just want to make sure that my logic is correct. My code "works", but I want to make sure of what it does. I think I am posting the val of the string to browser's memory and calling the test.jsp file. Is that what is happening? <!DOCTYPE html> <html> <head> <title>Page Title</title> <script src="http://code.jquery.com/jquery-latest.min.js"></script>
How to Query JSON Data in Ajax Request
I have a json file as: {"markers":[ { "latitude":11.58655, "longitude":122.755402, "type":"A"}, { "latitude":11.00698, "longitude":124.612801, "type":"B"}, { "latitude":10.30723, "longitude":123.898399, "type":"A"}, { "latitude":11.24775, "longitude":125.003502, "type":"C"}, { "latitude":11.03693, "longitude":125.719498, "type":"Z"} ]} and an ajax request as: $.ajax({ type: "POST", url: 'data.txt', dataType: 'json', success: function(data){ locations.length
How can i add mask filter to a jquery sliding drop down panel
I made a sliding panel with jQuery to add login form in it. I wanted to make something like xenforo login system Link : http://xenforo.com/community/ After you toggle the slideing panel in the link above the whole page background dims out and this is effect of masking seen in modal boxes and i need this to be done to the sliding panel i have made. Here is the example fiddle i made : http://jsfiddle.net/envira/yEzke/ Here is the code i am using : <div class="panel"> <div class="panell"></div> <a
How to validate form controls data size not more than 2.5 mb?
I have a form which has controls like first name, last name, etc and also file upload attachment. I need to calculated all the data should reach more than 2.5 mb. How can we do that with jQuery and show validation error on that page? form action="/ContactSubmission" class="form-horizontal" enctype="multipart/form-data" method="post" role="form" novalidate="novalidate"> <div class="form-group"> <div class="col-sm-5">
how to keep child div of same height and width when resizing parent div?
Actually i am resizing a container div by using transform: scale(value, value); Here is the fiddle Please look into it. I want to keep small circle of same size in every conditions when we scaled its container.
jQuery image slider stop when in position
I have a continuous scroll of images being pulled through from a database and I want to make the scroll stop for 3 seconds every time one image from the scroller moves into a certain position. Then after 3 seconds, the next one scrolls to the position and does the same thing.
set datePicker values
Hi, I am using the jquery datePicker like this: <script type="text/javascript"> $(function () { $("#dateClosingDate").datepicker({ dateFormat: "dd-mm-yy", changeYear: true, showOn: "button", buttonImage: "http://www.mywebsite.com/images/calendar.gif", buttonImageOnly: false }) }); </script> <input type="text" id="dateClosingDate" name="dateClosingDate" value="<?php echo $member_date_of_birth; ?>" autocomplete="off" readonly required> I want to set
enable and disable <select> on <select> change
Hi, I have two <select>s in my PHP website. cboSalary and cboCurrency. I use a blank value as null for both like this: <option value="" selected>[Unspecified..]</option> I want to know how can I enable the cboCurrency only if a value was selected in cboSalary therefore disable the cboCurrency when value in cboSalary was set to blank? Thanks, Jassim
javascript exception thrown only after load() and only in IE
I am using a in-browser pop-up (hidden div) with a full screen overlay set to 50% transparency to make the pop-up the center of focus. I utilize show() and hide() with no problems as long as the content of the pop-up div is hard coded in the HTML. However I need to have the content of the pop-up div be generated via a .load() or .ajax() (I have used both the problem is the same with each). The content loads no problem and the pop-up div is visible. However, when you click anywhere on the screen
Unreasonable behavior when dealing with variables ouside the callback.
var repeat = 1; function RefreshPage() { $.post("php/getchatmsg.php", function(data) { repeat = 0; }); alert(repeat); } This code will alert the value 1 on the first time the function RefreshPage() is run, but will output 0 on the rest of the calls, furthermore this code: var repeat = 1; function RefreshPage() { while (repeat == 1) { $.post("php/getchatmsg.php", function(data) { repeat = 0; }); } } just makes my browser crash UNLESS
default date is not getting set
Hi, I am using this code to set the default date of the datepicker to 7 days from today but it's not working and I am getting the datepicker blank. what's wrong with the code please? <script type="text/javascript"> $(function () { $("#dateClosingDate").datepicker({ dateFormat: "dd-mm-yy", numberOfMonths: 2, changeMonth: true, changeYear: true, minDate: +1, maxDate: "+90D", setDate: 1,
Does google js api make XHR?
I am trying to deconstruct an autocomplete that someone else wrote who is even more clueless than me. She basically did a cut and paste of an example she found somewhere and it worked. This example uses google apis, so I am trying to find out if google api makes the XHR or what is going on because I want local copies of jquery, ui, etc. Let me show you the code and please if there is a brief explanation as to why it would work but attempting the same with latest versions of jquery, and a theme roller
Team selection
I’m currently using a script/form that has served a purpose for me for some time but I keep thinking back to a vision I had some time ago that I was never able to master. The closest thing I can find to what I want is shown here http://www.dhtmlgoodies.com/scripts/drag-drop-quiz/drag-drop-quiz-d2.html but it’s still not exactly what I’m after (im not looking for a quiz) Basically I am creating a team selection page for my users (there only a handful of them) What I would be doing is list on the right
jQuery Css Selector
Hello, I have a question about jQuery and Css Selectors... My HTML is: <div id="rev_slider_3_1"> <ul style="Something"> <li style="Something"> <div class="slotholder"> <div class="tp-bgimg defaultimg" style="background-color: for example blue"></div> </div> </li> <li style="Something"> <div class="slotholder"> <div class="tp-bgimg defaultimg" style="background-color: for example
jQuery Menu
Hello! I want to know how i can do it that if i press at a link at my navigation (#home) then the div with the id home should be visible at the content. and if i press at another link then the other should be visible and the home should be hidden. how can i do this, im new to jQuery so i have no idea, please help me, thanks
listening to DOM events 4.2 tutorial question
Hello: I"ve been working on the jquery tutorial and have been trying to understand the difference between the following code $(document).ready(function() { $("#tour").click('button', function(){ }); }); $(document).ready(function() { $("#tour").on(‘click’,'button', function(){ }); }); the correct answer is the second bit of code, but I'm not sure why it is more correct than the first. The error message that comes up is as follows: "You'll need to target all 'buttons', so pass that in
Is there a workaround to this Autocomplete feature?
Hello Experts, First, hope it is ok to post a link from another source. On the link below: http://harvesthq.github.io/chosen/ we are very much interested the Standard Select part of the <SELECT>...</SELECT> option for two reasons. 1, it allows for autocomplete 2, it is beautifully designed. However, the issue we have run into is that it doesn't work for dynamically populated data. For instance, the code for SELECT box below, uses ajax call to a webservice to populate the buildingId
getting the contents
iam very new to xml parsing in jquery. i want to accomplish the below task which iam not able to. any help would be greatly appreciatedI have the below xml <svg xmlns="http://www.w3.org/2000/svg" class="no_class"><ellipse class="no_class" id="shape:45822758-f1cf-9985-7294-67dc74ef3a51" style="position: absolute; z-index: 5000;" fill="red" stroke="#000000" stroke-width="1px" cx="419px" cy="98px" rx="18px" ry="25px" val_fillcolor="red" val_strokecolor="#000000" itemtype="ellipse" PageNo="1" UserId="2"
$.getJSON Increase Timeout/Default Timeout
Hey all, I'm trying to figure out how to increase the default timeout setting for the .getJSON method call. We are using .getJSON several places in our code and it would be nice to not have to go back through and replace everything with the more generic .ajax method call. I've found examples on the Internet of increasing the timeout using the .ajax call, but I would prefer to stick with the .getJSON call. Does anyone know how to increase the timeout for that call? Also does anyone know the default
single quotes in data break the page
I have a php page that populates a form from data pulled from a postgresql database. Jquery is used to populate the form with the pulled data as below. If any piece if data has a single quote in it, like Jim's the the form is displayed but no data is populated in any field. $(document).ready(function(){ <? $i=0; foreach($keys as $key){ if ($i%2==1){ if($key!="reason" && $key!="parent_deceased" && $key!="to_account"
Functions not working in Internet Explorer
Hi! So, I have this page with a dropdown containing a list of states (id #province). When a button (id #buyThis) is clicked, the user is either given an error telling them the state is not allowed or, if it is allowed, a modal pops up with a checkbox they must check (id #age_verification) before proceeding. Everything works perfectly except on internet explorer. Nothing happens when the button is clicked, no modal, no errors...I'm wondering if I have a syntax error in my script. Thanks in advance!
viewport font refresh when resizing
I am using vw as units (also for font units) , it works fine for my needs but not when window resizing how can I refresh all vw units when resizing , maybe a jquery class already exists ? thanks
Unable to access POST variables on the server-side
I am trying to access a variable value. Here is my code: <script language="javascript" type="text/javascript"> function UpdateRecord(){ $.ajax({ type: "POST", url: "test.php", data: {name:"EG13291001"}, success: function(response) { alert("Success"); } }); } </script> <input type='button' id='button_id' value='Update' onClick='UpdateRecord()'>Here is my php code(test.php): <?php $num = (isset($_POST['name']) ? $_POST['name'] : "unable to access
why this code not working?!
Hi, I am using the following to set the text and readonly attribute of textbox when checkbox is clicked but it's not working properly. First when I load the page it works fine.. then I set click the checkbox so it will be readonly and text will change.. then when changing it back to editable it also works but the problem occurs when I change the company name then again click the checkbox to set it to readonly... nothing will work that time.. $("#chkHideCompanyName").click(function () { if ($(this).is(":checked"))
Make a button off with jQuery
Hi,I have a project that I have made a web application that shows some buttons which interact with the client and accordingly to the values of the buttons, it makes changes on the server such as: if you turn on a button on the site, on the server you can see a led on...and so on.What I want to do now is upon a value (that is displayed as well on the site) put the button off and keep it there for secure reasons lets say...the code for the buttons is above "<script>" "$(document).ready(function(){
undefined' is not a function (evaluating '$('#pf-article')')
I am trying to hide an element if another one exists $(document).ready(function(){ var pf = $('#pf-box').length; if (pf != 0) { $('#toTop').hide; } }); I get the error : undefined' is not a function (evaluating '$('#pf-article')') and of course there is an element id="pf-box" in my page thanks for helping
HOw to use localStorage to create an array used to hide certain table rows
I am trying to use localStorage values created on one page to hide table rows on another page based on similar text strings. It is a sharepoint page so the html is very verbose and hard to find the correnct elements. I've set up a fiddle here to the best of my ability http://jsfiddle.net/vhabhsrosed/62Kv5/1/ I have the local storage piece working from the first page but am having trouble using it as an array to indexOf values on the second page to determine which table rows should be hidden. Lots
Assigning before $(document).ready
Hi, I saw this code: var $element = $('#element'); $(document).ready(function() { console.log($element); }); If I understand this correctly above statement will work in most cases, but it's not 100% sure since DOM might not be loaded yet. This would be the better way, right? var $element; $(document).ready(function() { $element = $('#element'); console.log($element); }); I just want confirmation that the first example might not always work. Thanks in advance!
Implementing History.js
I'm so unbelievably angry right now for two reasons. One is that i can't figure this out, and the other is that the developer of history.js provided fairly shitty documentation for jQuery beginners. I also can't find a decent tutorial on how to implement history.js. I have one question before begging for help on this forum. Does history.js come along with the AJAX content loader script or not? I have my own AJAX but don't know wether to keep it or remove it when implementing history.js. Now on with
Add type=file
I'm rookie in jquery and and learning fast but this time I'm having trouble to figure out myself how that works. I have three columns and each column have images that retrieve from mysql which is works great. My next step problem I have, is that if any of tables image columns is empty in database or no file name in database, how can I show "type file" (upload) in table area using jquery if is empty in database ? please help thanks. Alidad
Switching from History API to hash navigation
I want to use History API to navigate between AJAX loaded content using url. The problem is that History API is not compatible with many browsers. So when my website is loaded on a browser that is not compatible with History API, i want it to switch to hash. Is this possible or not?
Trying to read xml file
In PHP I am querying my database and creating a XML document. that has the following layout. <markers> <mark traffic="" latitude ="" longitude =""></mark> <mark traffic="" latitude ="" longitude =""></mark> </markers> I have created the following code trying to read these attributes to display into google maps here is my Jquery $.get('/PHP/SQL_Maindata.PHP', function(d){ $(d).find('marker').each(function() { //gets Google LatLng var
How to append a form value to iframes src
I am trying to add a form value to an iframe src on another page. Here is the code I am working with on the homepage: <form action='local-agent-map.html' action="mapFrame"> <div class="form-group"> <label class="sr-only">Zip/Postal Code</label> <input type='hidden' name='uid' value='7214791'/> <input class="form-control" type='text' name='search' value='' placeholder="Enter Zip/Postal Code"/> </div> <input class="btn btn-default"
Ajax jQuery empty request
In my simple login page to send the login information to the servlet, and in response receives one parameter which is interpreted in jQuery. Data is sent correctly, go to the servlet which also sets the parameter correctly what I see in firebug in response header. The problem is when I want to download den parameter to a javascript variable. The request object is empty, while in chrome incpect see alert: Uncaught TypeError: Object has no method 'getResponseHeader'. When I display it using console.log
$.ajax - Accept..
Hi, Can someone explain how "Accept" works in a $.ajax call..?? If I set the Accept : "xml" and the webservice return Text.. what happens?? Is the error, complete or success function called?? Documentation seems a bit short on that point.. Thx in advance Soren
$.ajax
Hai, i have requirement where i am getting the data from an XHTML page through ajax call. the datatype is html , It is working fine in all the browsers and the response that i am getting is as expected but in IE8 ,the result is null... What is the issue?? Is there any particular syntax specific to IE8 for ajax...
How do I pass a portion of Json object to another page?
Hi, I have the following data returned from a call to a webserver and I am passing the username, password, firstname, lastname, etc to another page to be captured and used for other purposes. In the data posted below, how do I just pass only the tokenID to another page? If it is easier to pass entire object, that's fine too. I would appreciate your assistance guiding me. Thanks a lot in advance {"Value":{"TokenId":11, "LoginName":"Jerry.Mann", "Created":"2013-12-10T15:44:49", "Expires":"2013-12-31T15:44:49","
I cannot get array value inside a function.
hello, This is my program i need the values var values = [10]; pie.hover(function () { alert(valuesof[0]); var that = this.sector; this.sector.stop(); this.sector.scale(1.1, 1.1, this.cx, this.cy); }); when i alert it shows object Object,if i get the length of that array it shows 1 value is there. please help. thanks
Finding Child/Animate/AppendTo
Hi, I'm trying to find the first child of a parent, then animate it to a position, then remove it from the parent and add it to a new parent. I'm pretty sure I'm doing or looking at this entirely wrong however. Am I right, when you want to remove an element from it's parent and place it inside a new parent, you should appendTo the element? (place inside=nest right aswell?) Does this 100% remove the element and 100% create/move it to the new parent? So if I affect the elements new position is it completely
How do I preview data in accordion page?
Dearest experts, this is my first time here. So, please go easy on me. There are two functions in the code behind, one is getBuildings() and the other is getRevisions(). getBuildings makes a call to a php file called getBuild.php to populate the buildingID dropdown. getRevisions makes a call to a php file called getRevisions.php to populate floor dropdown based on valued selected from buildingID dropdown. the two dropdowns and an input textbox are in accordion page called Buildings. Everything works
Next Page