JQuery calling WebAPI
I have a script that is calling a WebAPI. If I host the web page and the API on the same server it works fine, however, when I move the API to our app server and the web page to the web app server, I get the following error messages when calling the URL of the API: SEC7120: Origin http://localhost:2020 not found in Access-Control-Allow-Origin header. SCRIPT7002: XMLHttpRequest: Network Error 0x80070005, Access is denied. I can access the service directly in the browser from both servers. My script
how to toggle between console and source in chrome
Hey guys, Sometimes , i like to add a breakpoint , to say a certain given line eg: ((this.options.position.x == 'center' && this.options.outside == 'x') || (this.options.position.y == 'center' && this.options.outside == 'y')) && (this.options.outside = false); and then go to the console and type in: this.options.position.x to see what really is (i know hovering over x also given the value , but thats not my question). so how do i switch between console and source , any shortcut ? without
How to get selected radio button id
Hi, I have the following div under which there are two radio button labels, I want to get the radio button id value and save it in browsers local storage and then on form load i need to set the same component i mean select the same radio component. Please let me know how i can achieve this with the below div where parent div has 2 radio button labels under it. Thanks, Raghuram. <div id="component_20" g360componentspec="type:FieldComponent;dt:1;format:input;fh:none;" g360layoutspec="l:124;lip:t;lif:f;t:29;tip:t;tif:f;r:118;riw:t;rip:t;rif:t;ra:+-;b:21;bih:t;bip:t;bif:t;ba:+-;o:hidden;lbpx:124;tbpx:29;wbpx:118;hbpx:21;efwpx:22;"
draggable layout: cancel click when mouse is dragged
I've created a layout which is horizontal draggable: http://codepen.io/moy/pen/xGmyZX To do this I've used a jQuery plug-in called drag-on.js (http://dragon.deparadox.com). The effect of the drag works fine, the problem is you need to find 'a gap' for it to work. Clicking another element (anchor/text/img) doesn't register the drag. So I need a way of cancelling the click event if the left mouse button is held and dragged. Does anyone have any ideas on how to do this? I've heard about e.preventDefault() but
Toggle button
Hi, I have created a custom toggle button through css. How should I take the state of this toggle button. Can anyone help me out. Thanks in advance.
making the menu text fluid
I'm trying to resize text in menu items using jquery. I managed to use the the specific selctors for the li and anchor elemets but don't know how to implement the algorithm. Can someone help please? I. Sher
Hide the character *
Hi, I am trying to hide a specific character in a survey; * How would you rate your overall experience with us? * Would you use our service again? I am trying to hide the * and the spaces so it only starts with question! I have tried various methods and either get; Nothing or the below via chrome; Uncaught TypeError: Cannot read property 'replace' of undefined
Why you should Learn Jquery?
JQuery promotes simplicity: Developers find jQuery is easy to learn this library is built on shorter, simpler code, after all. With simple syntax and open coding standards, developers can shorten the time it takes to deploy on siteany developer who has spent hours coding and testing CSS files will surely appreciate the simple implementation that jQuery brings to the table…
error a.setAttribute is not a function with jquery 1.4.4
Just after upgrading from v1.4.3 to v1.4.4 I started receiving this javascript error on the console, but apart from the update, I didn't do any code modifications. If I follow the console link, it takes me to this point in the source: attr: function( elem, name, value, pass ) { // don't set attributes on text and comment nodes if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) { return undefined; } if ( pass && name in jQuery.attrFn ) { return jQuery(elem)[name](value); } var notxml = elem.nodeType
$.ajax().done
Hello, I'm working on a function I have attached to a forms onsubmit event. The problem I'm having is that my form keeps submitting. I've localized the error to my first Ajax call. I've gutted everything from the function using comments to see when it would freeze on return false. The script will send even with everything gutted out of the ajax call, so I'm wondering if there's a problem with my structure here.. $.ajax({ method: "POST", url: "../../php/scripts/post_product.php",
How can I fix this broken jQuery?
I've got this code to, in response to a selection from a select element, populate a second select element (with "placeholder" vals for now): $(document).on("change", '[id$=ddlPaymentType1]', function () { var selects = [{ "1": [ ["value 1", "text 1"], ["value 2", "text 2"] ] }, { "2": [ ["value 1", "text 1"], ["value 2", "text 2"] ]
selecting li elements
I use the following selector to perform something on each element: $('div,article,aside,footer,header,main,nav,section,summery,h1,h2,h3,ul,ol,il,a,p').each(function(){ .... this_type = $(this).prev().prop('nodeName'); if (typeof this_tpe != 'undefined' ){ if (this_type == 'IL' ) alert(this_type ); } ............. ............. Problem is that I can't get some of the element types, like 'li'. Am I being mistaken or what: Regards I. Sher
Auto Suggest Data From Database
Hi, Good day! I saw this auto suggest like google http://www.freezecoders.com/2013/03/google-like-auto-suggest-search-using-php-ajax.html but my problem is when I type some word that not match in names but match word in description it shows on the list the name with that description. I want is if i type name all the names that match displayed but when i type description the description list will display. Thank you.
hello select box
hi i have one select box i have customer names in that box i want that if i select one customer the information of selected customer show below from database
I need help with some code I wrote, can someone tell me what I did wrong, it will not work
It is a show, hide when the radio button is pushed here is the code: HTML: <h1>Single or Recurring Choice</h1> <div id="payment_type"> <strong>Please select a payment type:</strong> <input class="option" type="radio" name="group1" value="single" checked="checked" /> Single <input class="option" type="radio" name="group1" value="recurring" /> Recurring <input class="option" type="radio" name="group1" value=“contact" /> Contact Us </div> <div id="single"> <!-- information goes here
Getting a list of all executing functions inside a plugin
I was just checking out the code for jBox.js (go to source and open jBox.js ) , basically i was more interested in the tooltip functionality . Once the jBox.js script runs , is it possible to track all the functions that execute inside jBox.js ? I.E. i am only interested in the functons that actually execute , because jBox.js is a multipurpose plugin , eg. you can use it for modals , tooltips and also a gallery , i only want to see the functions or code that is relavent to the tooltip functionality
iPad video not playing
Is there a way of forcing the video to play on iPad using your own play button. I have a play button at the bottom left hand corner of the screen that plays the audio but will not play the video at the same time when testing on devices. I've tried autoplay but it doesn't work here's the URL to the page http://188.64.184.150/Kids_App/App/App.html#song19
get selected option from dropdown after cloning..
After cloning the dropdown list i want to save the options selected in DB..pl. help me... <?php ?><!DOCTYPE html> <html> <head> <title></title> </head> <body> <form name="frmUser" method="post" action="leavesave.php"> <table border="1" id="table"> <tr><td> <select class="cat"> <option value="c">A</option> <option value="p">B</option> <option value="n">C</option> <option value="k">D</option> </select> </td> <td><select class="item"></select></td>
See the values inside a object literal in chrome devtools .
I was just playing around with jBox.js , espically the tooltip functionality of this particular plugin and basically as soon as you click on the tooltip the following code is executed: this.pointer = { // "position" is "bottom" in this scenario. position: (this.options.pointTo != 'target') ? this.options.pointTo : this._getOpp(this.outside), // "xy" is "y" in this scenario. xy: (this.options.pointTo != 'target') ? this._getXY(this.options.pointTo) : this._getXY(this.outside), align: 'center',
loading multiple jquery libraries from javascript file
I am looking to load multiple jquery libraries from javascript file and then also include plug code in it what is the best possible way to do this
Tumblr Post Date Order Not Displaying Correctly
Hello, I am wondering if there is any script or anything I can do so the posts on my tumblr website will display in the correct order when you are viewing the appropriate tag. They seem to be in the correct order when you are on pages, but if you look at specific tags, for example, some things will be in the wrong order (an older date before a newer one). I like to backdate and right now if I post something and put it for a few months ago it will display in the July posts (again when under the tag).
I get the returned data from the Controller OK, but it needs to go to a spot in the code, as a parameter
Hello I get the results from the controller alright as I can print-text them at a given div spot. However, I want them to go to an array as a parameter, but this array is located in another function well below the response of the controller, so as the values are local, they dont get passed down to the place I want. What this does is actually color me red the booked dates in a datepicker. Separately all the snippets do great but when I put them all together I get that problem. As you can see, for
jquery ajax beforeSend not working.
Hi, I have a problem using ajax beforeSend. I execute a php file using this: <li><a href="#" onclick="window.open(file.php?c=<?php echo $c?>&m=<?php echo $m?>')">Registro personale</a></li> in file.php there is a control: if (isset($_GET['c'])) { $a1 = $_GET['c']; $a2 = $_GET['m']; $a3 = 0; echo "<script type=\"text/javascript\">\n"; ?> inviaClasse('<?php echo $a1?>','<?php echo $a2?>','<?php echo $a3?>','<?php echo $sessione?>');
json not working
<script> $("#clearPoints").click(function(){ $(".point").remove(); }); function LoadFactions(){ $("#actBox").hide(); __t = -1; __f = -1; $("#factlist").empty(); $("polygon").remove(); $(".point").remove(); $(".captionzzz").remove(); $.post('engine.json.html', function(data){ var f = jQuery.parseJSON(data); f.factions.forEach(function(faction){ _factions[faction.id] = faction; $("#factlist").append("<li class=\"fact fact"+faction.id+"\"><div class=\"factSquare\" style=\"background-color: #" + faction.color
dropdown list not working after cloning
I have the following code for cloning the cascading dropdownlist...it is working when the page is loading ...but after adding a dynamic row the dropdownlist in the newly added row is not working...Please help me... <!DOCTYPE html> <html> <head> <title></title> </head> <body> <table border="1" id="table"> <tr><td> <select id="cat"> <option value="c">A</option> <option value="p">B</option> <option value="n">C</option> <option value="k">D</option> </select>
Uploading content blocks and pages entirely
Hello . Does not solve the problem . But the problem is the following . Now done uploading via ajax entire page , here : $(document).on('click', '.link', function(e){ e.preventDefault(); var link = $(this).attr('href'); if (link == 'index.html') {$('#content').prev('.slider').show();} else { $.ajax({ type:'post', url: link, success: function(mes){ $('#content').prev('.slider').hide(); $('#content').html(mes); } })} }) But there is a need to load not only the entire page , but just some blocks from
how create a simple slideshow and some controll buttons.
Hello again, I am trying to make this little slideshow, it works, but i can't write correct function for buttons click. i want every time that a button is clicked, its related div display. and then slideshow continue its way. thank you all. demo: http://jsfiddle.net/sabeti05/dsagcc5u/ html <div id="slideshow"> <div class=" hide block"> one </div> <div class="hide"> two </div> <div class="hide"> three </div> </div> <button
Not Able to Get Height of Position Relative Element Using jQuery
I need to have a position relative div plus some some position absolute contents inside it. Now I am trying to dynamically calculate the height of the #one and then apply it to top of #two at this demo JSFIDDLE but I am getting 20 (it seems it is not calculating the height of the image inside the #one! can you please let me know why this is happening and how I can prevent it? $(document).ready(function() { var contentheight = $('#one').height(); console.log(contentheight);
How can this verbose jQuery be elegantized?
I have 5 rows that each have an identical selection element (or dropDownList) in the first cell of each row. Choosing a value from that populates the values in another selection element. How can I populate the selection items, and in a way that is less verbose than the "brute force" approach here: $(document).on("change", '[id$=ddlPaymentType1]', function () { var value = $(this).val(); if (value == '1') { $('[id$=ddlAccount1]').text("Replace this with the values for
Why does my checkbox's text continue to show when I hide or slideUp the checkbox?
I have created a checkbox in the code-behind like so: Checkbox ckbxSendPDFToThisEmailAddr = new CheckBox(); ckbxSendPDFToThisEmailAddr.Text = "Send PDF to this email address?"; ckbxSendPDFToThisEmailAddr.ID = "ckbxSendPDFToThisEmailAddr"; ...and am endeavoring to conditionally show or hide it in the client/jQuery code based on which of two radio buttons the user selects: $(document).on("click", '[id$=rbPaymentForSelf]', function () { if (this.checked) { . . .
About Using Bind()
About method Bind() What is the benefit of using bind()? I have two example using binding or another method. Use can use without bind(). Is there a situation that you should use bind() only? https://jsfiddle.net/8he0xmp3/1/ https://jsfiddle.net/4465gLfe/1/ Thanks!
Validate User Password won't work
HELP!!!! I'm trying to show a popup modal box with a password field inside so that the users will type their password, if the password is invalid the page won't refresh and will show an alert that the password is invalid, if its correct it proceed for inserting in database here's screenshot here's my code <div class="modal fade" id="confirm-submit" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog">
Issue with prependTo() and hide()
I have a JS script that will execute an ajax check every X seconds for new content and if any is found, it will prepend it to the top of a timeline. I wanted to get an effect of it sliding down the other content of the timeline, Heres the script thus far: $.get( '/some/url', function ( items ) { // Error: Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'. $( items ).hide().prependTo( ".timeline" ).slideDown(); // This works fine, just
Simple script, but could I have done it better.
I developed a very small script to look through a sharepoint announcement for attachment links, then convert them to thumbnails when the page loads. It all works, but I'm looking for feedback on what could have been done better: HTML (don't have much control over it, sharepoint): <div style="width:100%;display:block;overflow:auto;" class="imthumbs"></div> <div style="padding: 6px 4px;width:100%;" class="imattach"><b>Attachments:</b><br/> <div style="margin-left:12px;margin-top:5px;"> <TABLE border=0
enable and disable items in menu in jquery
Hi in my application there is a menu. following is the menu <div id='jqxMenu'>
<ul>
<li>About Us
<ul>
<li><a href="#">History</a></li>
<li><a href="#">Our Vision</a></li>
</ul>
</li>
<li id="account" >Accounts
<ul>
<li ><a id="cpv">CashPaymentVoucher</a></li>
Code does not work in Chrome or Firefox.. but it works in Safari
Hi, I have a Limesurvey survey where I'm asking respondents to enter the name of the company where they currently work. I also have a list (from previous versions of this survey), with common junk answers for that question. I want to validate the input against that list. If they enter anything from the list, I want to have a warning pop up. The folks at the Limesurvey forum gave me some code to try out. Unfortunately this seems to work only on Safari and IE, but not on Chrome or Firefox. I have had
Filtering the list based on the keyup event in text box
I am trying to create a filtering list(ul li) based on a key up event in the text box. When the user types the li items that containing typed in words needs to be displayed and others needed to be hidden. The problem I am facing with the :contains is that it is case sensitive. Is there any way I can overcome this. I have given my sample html and script. <input class="text-box single-line" data-val="true" data-val-required="The Skill field is required." id="SkillTitle" name="SkillTitle" type="text"
converting xml tree to an html expandable tree using jquery
so thats what im trying to do. its working fine. this is my code: what i want to do i have an image assigned to each type of child, or node. for example i created the class CD so that i can insert in the place of the + the image on the link i put here. as you can see, its working here: https://jsfiddle.net/8qd2xurm/1/ but not when i use it on the web server with the official html and xml files. this is the xml file im using as example: http://www.w3schools.com/xml/cd_catalog.xml any help is appreciated.
Removing button inside THEAD TH not working in Chrome
Hi, I have this piece of code which works in IE 11 but not in Chrome. Any advise on how to make it cross browser ? $(oTbl).find('thead tr th button').each(function (index, item) { $(item).remove(); });
Jquery Ajax works fine on my localhost but not working on server
Hi, Everybody, I'm done searching and can't find the solution to my problem, Hope, somebody's going to save my life. I've enclosed two ajax requests in jquery onclick event having id (manifest_id), the first ajax request having url (get_manifest_record.php) returns html table and it displays Fine, but the second ajax request having url (populate_field_man.php) is not getting fired, it should populate some of html textbox fields, and the most important thing is that it works fine on my local machine
Next Page