Sorting divs based on the value of a child div
I have a table of links, except it doesn't use a <table> tag, its all divs: <div class="matchrow"><div class="channelname">Link 1</div><div class="app">Red</div><div class="language">en</div><div class="kbps">320</div><div class="link"><a href="link1.html" target="_blank">Watch</a></div><div class="clearb"></div></div> <div class="matchrow"><div class="channelname">Link 2</div><div class="app">Red</div><div class="language">en</div><div class="kbps">375</div><div class="link"><a href="link2.html"
How can you divide the .duration in html5 audio and video player by mins and sec??
.duration on html5 is being display by seconds. the problem is what if the lenght of the video is 4:31 that will be 271 seconds right? how can divide it like 4:31?? this is the sample code alert(song.duration / 60) the result is 4.516666
manupulating table value
Hi, I am new to jquery. I have a table generated on fly <table id="rowclick1" class="rowclick"> <thead> <tr> <th> Delete</th> <th>ISBN</th> <th>Price</th> <th>Quantity</th> <th>Total</th> </tr> </thead> <tbody> <tr> <td><input type="checkbox" id="1" value="yes"></td> <td>row 1</td> <td><input name="price" type="text" id="price" value="15" size="6" /></td> <td><input name="qty" type="text" id="qty" value="15" size="6"></td> <td>1</td> </tr> <tr> <td><input type="checkbox"
$.ajax returns 0 as HTTP error code instead of 404
Below is my ajax call from the HTML page. Its actually a ajax call from an interation block. In this I am expecting that a couple URLs will fail with HTTP code as 404. From FireFox Net console i could see that the HTTP status as 404. But the jqXHR.status is 0 (zero). Could somebody please explain why its return 0 when the actual HTTP response is 404? $.ajax({ url: serviceURL, type: "POST", async: true, crossDomain: true, contentType: "text/xml", context:
delete image from database
Hi, i'm trying to delete images under jquery or ajax, i do know how to delete from php. Is because i'm rookie and still learning ajax and jquery, I kind of need help with sample of basic code of jquery or ajax to delete image file name (not row) from database.. Does anyone can help me how to write that code to delete image file name from database when press button after retrieve image from database please! Pretty please... thanks. AM
getAttribute vs attr()
Just a quick technical question about why I couldn't use getAttribute() inside a jQuery function? I would get an error message, getAttribute is not a function. So I went and used attr() instead but what gives?
xml output in lists with progressbar
OK, I almost have everything I need for this silly little xml read and output. The last thing I am trying to do is associate a progress bar with a probability. I ended up modifying the xml so i could read each probability so it looks like this: <?xml version="1.0" encoding="UTF-8"?> <bn> <node> <name>Stability</name> <state prob="0.15">Low - </state> <state prob="0.25">Moderate - </state> <state prob="0.60">High - </state>
Gary Seckendorf - Use jQuery in ASP.Net
Hello, My name is Gary Seckendorf. I am beginner in jQuery. I want to know how jQuery use in ASP.Net.? Regards Gary Seckendorf
Javascript and ajax not displaying autmatic filled values (only on IE8)
Hello everyone, I have 2 fields (representing iban account and bic code). When I fill the iban, I want the bic to be filled automatically. I use a small scrip doing it and it works well. Unfortunately, it doesn't work for IE8 (it works for Chrome, Firefox, IE11). Here is my script : <label for="test">BIC</label><input id="whatever" type="text" name="testWhatever" value="" class="ajax up" maxlength="11" onchange="getAjaxLabel(this,'updtComp','warning',null,true);" size="20" /><span class="mandatory"> </span></p>...
upload images...
Hi, I have project that allow me to retrieve five images from mysql (using image file name) and I be able to see images. And please see this bottom code.... function readURL_3(input) { if (input.files && input.files[0]) { var reader = new FileReader(); reader.onload = function (e) { $('#images_3') .attr('src', e.target.result) .width(170) .height(170); $(this).css('padding',
How to prevent the user from repeating a character more than three times in the same word using jquery
good morning everybody,,, How to prevent the user from repeating a character more than three times in the same word like this : "hiii" its possible, but "hiiii" not possible type in textbox,indicator is stopped. I wnat like this site to add advertising look the textbox : الإعلان * I tried this code : <input name="text1" type="text" class="mult"> var mult = false,prev = 0; $('.mult').keydown(function(e) { if (!mult) { mult = true; prev = e.which; setTimeout(function() { mult = false; }, 10000) } else
$.getJSON is not working in Chrome. But working if we use a web server.
Hi Guys, I have a simple HTML file which is actually making some bunch of ajax calls after it reads the URLs from a json file. So to read the JSON file, i am using the method $.getJSON as below. This working fine, if I run the HTML file as a application via Apache web server. $.getJSON("WebServices.json", function( response ) { But if I run the HTML file as a simple html file directly on Chrome browser, I am getting the error below. However the same code is working fine with IE and FF. The json
In what order are css files prioritized
For instance: If I have two css files and both have some of the same classes, in which order does the browser attach priority.
How to bypass checkboxes when checking for change event
Hello, Im trying to to bypass a checkbox selected when checking for a change event. My code is as follows but is not working: $("#detail").not("input:checkbox:checked").change(function () { changeflg="true"; });
Drag and Drop listbox elements up an Down
I am new to jquery and want to move elements in listbox up and down with drag and drop. Is it possible. Thanks in advance
call jquery from document.write
Is it possible to call jquery functions in document.write ? Like google ads, I want to call document.write from domain A back to a page on another domain. The way i do this for text is simple, but I want to also call more complex javascript functions and I would like to use jquery functions.... Is it possible? Thanks
jquery quiz show result as html output
Hi, I am working on a quiz using jquery. The result is shown as alert window. But it is not working sometime. I want to add following functionality. 1) Show final result as HTML output. 2) Submit answer on radio button check and not on NEXT button. 3) If checked answer is correct,make it GREEN font or if it is wrong make it RED font. The link for fiddle is http://jsfiddle.net/3kpFV/80/ Please reply. Thanks.
Error while fetching data from cross domain using ajex
when i try to fetch the data using Jason from cross domain i am getting this kind of error "Error: jQuery1910031708905171111246_1388038501367 was not called" i am using ajax callback functionality and my jQuery version is 1.9.1. $.ajax({ type: "GET", url: 'my url', //the script to call to get data jsonp: "callback", dataType: 'jsonp', //data format timeout: 10000,
What do you think about my new project?
Hi all, I'm sorry for my bad english. I'm trying to create a new javascript library to build stylesheet on the fly. This library is using jQuery as its core. Please visit my project Tocm Library and tell me what do you think about my project. Whether my project deserve to be continued? Whether my project have a future? Thanks, Nanang
jQuery 2.0 | Youtube API 2 - Get data of each video ID from Playlist feed excluding private or deleted videos
Using the Youtube API 2 for embedded iframe, and after dynamically building a list of videos from a playlist feed which is rid of private or deleted videos, I aim to retrieve the duration of each fetched video through jsonc, kinda like so: // Code to first display playlist feed and remove private or deleted videos (if any) not included here. . . . var vid = Array(); $(".list:visible").find('.videoID').each(function(data){ vid[data] = $(this).text(); var video = '//gdata.youtube.com/feeds/api/videos/'
more questions on xml and toggle
I am reading xml just fine and displaying embedded<li> selectively using toggle(). I would like to diplay a plus sign next to items that haven't been expanded, and a minus sign to indicate that something can be collapsed after it has been expanded. I can show a plus sign easy. I can even show a minus sign, but it get s applied to all the <li> and I can't seem to get it to switch back to plus either. I have tried to accomplish this by writing various iterations of a function inside toggle. I would
Ping test for external URL (cross-domain) using JQuery
I am trying to do an PING test to an external URL to see it is available or not. So i want to make an HTTP call to than external URL and expecting the status as 200. When i tried with $.ajax, $.post and $.get and all, i came to know that there is Cross-domain issue. Then tried again by creating a proxy in my apache server, as below. RewriteRule /l2/eddUtilityService/eddUtilityService.wsdl http://AAAAAAAAAA.com:59060/eddUtilityService/eddUtilityService.wsdl ProxyPassReverse /l2/ http://AAAAAAAAAA.com:59060/
How can I validate a textbox for numbers only?
Hi, I’m trying to validate a field for numbers only. I’ve been trying the following script but it doesn’t work. <script type="text/javascript"> $(document).ready(function () { $('#saveBtn').click(function () { var trial = $('#HomeworkGrade').val(); var numbers = /^[0-9]+$/; if (trial.value.search(numbers)==-1) { alert('Correct data is entered')
.on() target and selector question
Hi: This is for a modal div with mask. <body> <div id="content"> <p>blah</p> </div> <div id="modal-box"> <a class="close-btn">there's an image for this, but whatever.</a> </div> </body> So the #modal-box is on the page like it's supposed to be according to the on() documentation. The #mask div gets injected; both were set to display: none in the css. $('#modal-box').fadeIn(300); $('body').append('<div id="mask"></div>'); $('#mask').fadeIn(300);So I want to click the .close-btn or the
modify this code to add more combo boxes
Hi, I have the following code.. It's adding (creating) a hobby textbox when clicking the link. <script type="text/javascript"> var counter = 0; $(function(){ $('p#add_field').click(function(){ counter += 1; $('#container').append( '<strong>Hobby No. ' + counter + '</strong><br />' + '<input id="field_' + counter + '" name="dynfields[]' + '" type="text" /><br />' ); }); }); </script> I also have the following code: <div id="container"> <select name="cboResidenceLocation"
Crazy Input Behavior in IE9 & IE10
I'm using jQuery 2.0.2. I have a page with no forms, but multiple inputs all activated by jQuery. It's a pretty simple setup. The problem I'm having is that, if you type a number into a text input and hit return, that activates that input's "keypress" event, but then it also activates the "click" event on a completely different, unrelated button. It is completely wacky and makes no sense at all! I made a very boiled down test case you can check out here Or for inline code, here is my HTML: <section
xml output
I am reading an xml document and I have a couple of additional things I would like the output to "do": Here is the xml: <?xml version="1.0" encoding="UTF-8"?> <bn> <node> <name>Stability</name> <state>Low - <state-prob>0.15</state-prob> </state> <state>Moderate - <state-prob>0.25</state-prob> </state> <state>High - <state-prob>0.60</state-prob> </state> </node> <node> <name>Free/Fair
Using .on() instead of .live()
I'm creating a plugin for Wordpress utilizing jQuery to handle submission of a form. My script is working fine when I use .live(), but looking at documentation, .live() has been deprecated since version 1.7 and states that I should be using .on() (which I guess I should be using since default Wordpress 3.8 comes shipped with jQuery 1.10.2). Problem is, .on() is not working even thought .live() was. Here's my working .live() code: jQuery(document).ready(function( $ ) { $('#swt_createRaceTypeForm').live('submit',
Need help with Wordpress "hashbang" problem
Hi, I'd really appreciate help with this. When I share a page URL on LinkedIn, it appends a "#!" after the slash. When the page renders, it displays mangled. I use Wordpress, but I'm no pro. I tried installing a redirect plugin to send #! URL's to the source URL, but it didn't work. Is there an easy fix for this? Here is the page I'm having problems with specifically: http://www.ideafaktory.com/best-articles/ Here it is with the bad URL http://www.ideafaktory.com/best-articles/#! I did an ugly
jQuery infinite scroll problem
Hello! How do I get jQuery Infinite Scroll Helper to return the next page? Right now it's returning the existing one: http://jsfiddle.net/frank_o/63hUp/ As I wasn't sure how to properly emulate pagination in JSFiddle, I've provided a demo Rails app with working pagination that's easy to get up and running: https://github.com/frankie-loves-jesus/proper-infinite-scrolling/ Location of JS: app/assets/javascripts/application.js Location of pagination link: app/views/forem/forums/show.html.erb#L22
Tomorrow and next day date
I need some jquery for an arrival and departure date which is tomorrow and the next day which is mm/dd/yyyy. Can anyone help?
Detect if any fields have a specific value on form submission
I'm trying to prevent a form from submitting if any fields on there have a specific value: $('#form-register form').submit(function() { if ($(this).find('*[value="Select Brand"]').length > 0); alert ('Please select an appliance and a brand'); return false; });However I seem to get the alert message every time I try to submit the form, even when no fields have that value. There is a select box that has 'Select Brand' as its default value, however I still get the message even when
Cluetip "delete" my images after ajax update
Hi, I have a problem with a dynamic forum where images are displayed in cluetips. If an images have been shown in a cluetip and the forum is updated by a ajax function is only the new images visible in cluetips. See more here: http://goodbeer.dk/forumtest.php and try to expand a tread by clicking on the magnifier or read my code here: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "> <html> <head> <?php include("../includes/tinymce3.inc"); ?> <link rel="shortcut icon" href="favicon.ico">
How to use Jquery animate function with links that are styled in a class?
I'm looking for the correct syntax for make this work. The thing is so simple as select different colors for links (link, hover, visited and active) depending of the color theme of the webpage. Let's see: CSS --- .DarkTheme a { color: #66cccc; } .DarkTheme a:visited { color: #66FF99; } .DarkTheme a:hover { color: #AAFFCC; } .DarkTheme a:active { color: #FFFFFF; } ------------------------- JQUERY (I'm using JqueryColor
Send selected value to new page
Hi; I have 2 drop downs, the one under changes based on whats selected on the one on top. I want to send the value of selected city to the function and it reloads a new page in the div. But it doesn;t work and I don't see any errors in Fire Bug. Please guide. Thanks <script type="text/javascript"> function update_suburb_dd() { $.post('page.php/'+city, { city: document.form.city},function(output){$('#suburbs').html(output).show();}); } </script>
Copy text from textarea to file and prompt user to save on desktop
Hello all, Please help me, I am new to jQuery. ToDo : - Copy data from textarea in to a text file (default file name "output.txt") - Prompt user where he want to save Thank you in advance
jquery form with upload image
Hi all, how can I create form with this attributes: - name - photo ... so, as you see, I would like to upload a photo and then (before submitting form), that photo should appear and I can edit it to my size. - resize, move it ... I hope you understand me ... this would be very helpfull for me .. thanks a lot
preview images before upload it
hi, i have preview images before upload is works great in jquery see the code ... and in the form i have two different images and add type=file in each images and hide, so meaning that when click on the image it will prompt the upload form, however, when i clicked on first images under (id= "images_1") and replace with other images and see the preview image is works fine, but in second images (id=" images_2") when i clicked to replace images, it does not replace in second images but it replaced first
Web page full of different Ajax requests with different refresh intervals
Hi, I've developed a specialised web server. It is capable of serving up a list of different values from attached engineering systems but, at the moment, it needs Ajaxifying and I will be doing the work using jQuery. The idea is that a single web page might contain a few dozen Ajax URLs which are refreshed at potentially different intervals (e.g. anything from 5 to 30 seconds, to be specified by the engineer who composes the web page). As the values are collected, the jQuery will simply drop the
Upon Render Remove Countries From DropDown List
Hi, I have a dropdown list of countries used to select which countries I'll ship to. I really only need it to be United States and Canada.... but the list of options includes about every country there is. I cannot alter this list, there is a template tag that simply spits out the following code when the page renders (list shorted for ease of display) <select name="billing_country" onchange="document.billing.action='checkout3.asp?step=3&action=updatecountry';document.billing.submit();" class="txtBoxStyle">
Next Page