is it allowed to reuse a event object?
var e=$.Event("myEvent"); $("#id").trigger(e); //some code here $("#id").trigger(e); is it OKto reuse a event object?
essential methods for event system?
i have never used jq's event system and customized event i want to ask that,is it enough for usual usage to know the two methods $.Event() and ele.trigger() is it enough to run a customer event?
How to get the value of attribute of xml element containing URL
Hi there, I have an xml node like this <warnings url="http://abc.xyz.com/test.html?xy=15"> <<event desc="this is a test"> </warnings> I tried the following line of code console.log($(this).find("warnings").attr("url")); which gives me undefined but when I try console.log($(this).find("event").attr("desc")); I get "this is a test". Because the URL has some special characters such as : / ? = am I getting undefined? How do I get this url value? Thanks for your help Joe
Checkbox Checked and Uncheck another one
Hello Everyone, I have a repeater control in which has Data and checkbox shown as PK(Checkbox Column) FiscalYear Status Checkbox1 2013 Approved Checkbox2 2013 Approved Checkbox3 2013 Approved Checkbox4 2013 Approved Checkbox5 2014 Apprvoed Checkbox6 2014 Apprvoed Checkbox7 2014 Apprvoed Checkbox8 2014 Apprvoed
Change bg colour on rows based on cell value
I have a column containing "Section1", "Section2" and "Section3". I want to find the right column (first one), and the cell that contains "Section1" and for that row I want to set a blue background. Also I want to do this for all the rows beneath until "Section2" is found. Then the row for "Section2" will have another colour, as well as the rows beneath until "Section3" is found and so on... This is the result I would prefer: How could I achieve that? <table class="fooBar" width="200" border="0">
Find all cells within a specific column and change color on certain characters
I need to perform the following on my table: Find a specific column by it's name or class (<th class="ColHeader1" scope="col">ColHeader1</th>) Within that column I need to find all the cells containing "1" The cell could contain a string like "1, 2, 3", and then I need to set the color red only on "1". How can I do this with JQuery? So here is the table: <table class="fooBar" width="200" border="0"> <thead> <tr> <th class="ColHeader1"><b>ColHeader1</b></th> <th class="ColHeader2"><b>ColHeader2</b></th>
Jquery click event is not getting triggered in the mobile browsers
Have been trying to perform a DIV hide show on a page of my website. It was working fine with plain javascript but noticed it was not working when simulated on mobile devices..after bit of research I changed my code to the following, is there anything wrong in it ? <script>
$(document).ready(function () {
var portfolioDiv = document.getElementById('portfolio');
var resultsDiv = document.getElementById('results');
$('#RenderPortfolio_Btn').on('click touchstart',
How do I save and restore select options?
I have a report selection page with one select element. I have 44 options now but expect the list to grow. What we'd like to do is have a radio button for each category and a button for all. My idea was to save each logical group of options into global variables in the document ready() function var allElems = save all options var mixedElems = save 'Mixed' class options var tbElems = save 'TB' class options var qhElems = save 'QH' class options
If statement
I have form input with default value of the product bid price. The input has an id of jsBidPrice. And there is another input without any value and has and if of minBid. <form id="placeBid" action="/add-new-bid/{{$product->id}}" method="Post"> {!! csrf_field() !!} <input type="submit" id="bidSubmit" class="btn btn-success" value="Siūlyti kainą" style="float: right" /> <div style="overflow: hidden; padding-right: .5em;"> <input type="hidden" value="{{$product->bid_price}}"
Loop through select values with image
Hi, i have a select box which accepts multiple selections (Bootstrap Select) when an option is selected i want to display an image. The image part i have done! It successfully echo's an image based on the value. But how do i loop through the options so it shows multiple images when more than 1 option is selected. $(document).ready( function() { $("#PrimaryTrade").each(function () { $(this).on('changed.bs.select', function (e) { $("img[name=image-swap]").attr("src","/images/icons/" + $(this).val()
Append div under 2 levels of div
<div id='grandparent1' class='gp'>test</div> <div id='parent1' class='p'>test</div> <div id='grandparent2' class='gp'>test</div> <div id='parent2' class='p'>test</div> <div id='grandparent3' class='gp'>test</div> <div id='parent3' class='p'>test</div> I want to append div with id=child1 to div with id=parent1 ; div with id=child2 to div with id=parent3; div having id=child3 to div with id=parent3 it is must to check grandparent and parent id cannot just do $.("#parent1").append("<div id='child1'
Form Data in a form
Hi guys, At a click of a submit button, i need to know how possible is it to get the data/contents submitted into a new file. this doesn't involve using server or anything else. just submitting the form, and getting the contents in another file. i have done so many lovely stuff with jquery but i seem to find this difficult. i''m ashame to even share my code sincerely. thanks for your help. regards.
best pratics
Hi, I have a table with Rooms - 1 + Adults - 1 + Children -1+ when I click on Rooms + I need to add Adults row and Children row. Is better if I add another table or add simply the row? Consider that when I click on Room - if there are the rows about Adults and Children this row must be deleted Hope I explain enough clear my problem.
What could be wrong with this code?
$(document).ready(function () { $('#newsletter').click(function() { $myAction = ($('#newsletter').prop('checked') ? 'action-1.htm' : 'action-2.htm'); $('#frmContact').attr('action', $myAction); }); }); I'm a newbie in jQuery. The instruction in line 4 never executes, I'm debugging it with Firebug, I place a breakpoint on it, and it never stops there, but a breakpoint in line 3 does. What could be wrong here? Thanks in advance Rafael
how to access Price from Yahoo api
Hi I'm using the following Rest call http://finance.yahoo.com/webservice/v1/symbols/GSK/quote?format=json&callback=? When I put this in the browser I can see the returned data in json format. I now need to access the price, so I've added the following code to the webpage: $(document).ready(function() { var wsURL="http://finance.yahoo.com/webservice/v1/symbols/GSK/quote?format=json&callback=?"; $.getJSON(wsURL, function (dataone) { var test1 = dataone.list.resources.resource.fields.price; $('#price').html(dataone);
How to show message, in jquery by fetching the value and match and then insert value and show jquery message
THIS IS first_page <html> <head> function checkAvailability() { jQuery.ajax({ url: "insert.php", data:'sub_name ='+$("#sub_name").val(), //data:'sub_mark='+$("#sub_mark").val(), type: "POST", success:function(data) { $("#user-availability-status").html(data); }, error:function () { } }); } </script> </head> <body> <form class="" name="" action="insert.php" method="post" > <fieldset> <!-- Subject Name input--> <div id="frmCheckUsername"></div> <div class="form-group"> <span id="user-availability-status"></span>
Sticky sidebar
Can suggest a good plugin for manage properly and create a sticky sidebar? Thanks
Scrolling Page
Hi! Does anybody knows what is the best plugin to create a scrolling one page like logitech? http://www.logitech.com/en-us or http://www.hugeinc.com/ Thanks!
Searching for a specific String-Format
Hey there, i have a little problem I can't really solve. I have a given website where I want to color dates that are overdue by a red font color. The problem is this. The date is implemented in a DD.MM.YYYY format in a title attribute of a span tag. Is there a possibility to get back all elemets that contain a title with the format "XX.XX.20XX" where the X has to be a number? Thanks in advance for your help and Greetings Chris
what's the corespondding method for getBoundingClientRect?
ele.getBoundingClientRect().top how to get this result by jQuery?
Changing aria attributes
Hi, I'm trying to learn how to change aria attributes with jQuery. For this I have created this codepen. However it's not working at all. What is my mistake?? Thanks
How to load dialog before php file.
Hi everybody, I need to know how can I load a dialog before this: $("<form method='post' action='registroQuadri1.php' target='_new'><input type=hidden name=a value='"+arg1+"'/><input name=b value='"+arg2+"'/></form>").appendTo("body").submit() I've tried this: $("#esegui").dialog({ "title": "RegistroOnWeb - Attesa programma -", height: 150, width: 430, }) $("<form method='post' action='registroQuadri1.php' target='_new'><input type=hidden name=a value='"+arg1+"'/><input
What is the difference between $.hide("slow") and $().hide("slow")?
What is the difference between $.hide("slow") and $().hide("slow")?
jQuery events execution delayed on iOS
I have a serious problem with my jQuery events. All the jQuery events in my .js file are performed with serious delay (more than 4 seconds) after the event is triggered. Here's the code JSFiddle $(document).ready(function() { var headerWrap = $(".header-wrap"); var hOne = $("#header-section h1"); var buttonMenu = $("header button"); var menuSlide = $(".menu-slide"); var menuSlideAnchor = $(".menu-slide a"); menuSlideAnchor.on("click", function() { $("button i").toggleClass("fa-reorder fa-times");
Why is class still exist after removeClass?
Why is class test still exist after removeClass? <style> a.test { font-weight: bold; } </style> <script> $( document ).ready(function() { $( "a" ).click(function( event ) { removeClass( "test" ); alert( "The link will no longer take you to jquery.com" ); event.preventDefault(); }); $( "a" ).addClass( "test" ); });
Drag and resize of n objects and save of the position and size
Hello, I try to create a possibility that a user can move and also resize objects (div). After chabge the system should save this and remember next time. 90% works. But if i resize and move a element and reload the page the position and new size is correct. If i resize now again something, the second element which i not touch moved somewhere. I don't know why this happen. Any ideas? See https://jsfiddle.net/couganet/tdb94bpp/1/ Thanks Mark
appending code from two functions jquery
hi to start here is a copy of my code var userid ='UCLdin3PebPaIVQdIC7Lp-kg'; var devkey ='*****************'; $(document).ready(function(){ $.get( "https://www.googleapis.com/youtube/v3/channels",{ part: 'contentDetails', id: userid, key: devkey}, function(data){ $.each(data.items, function(i, item){ pid = item.contentDetails.relatedPlaylists.uploads; getVids(pid);
JQuery 2: isArray is not a function on IE11
Hi, I am using Jquery 2 on IE11 and getting this error - "Object doesn't support property or method 'isArray'" It's weird because IE 11 should have it's own isArray. On all other browsers like opera or chrome everything works. And I am not in compatibility mode in IE and not in a debug mode. Have anyone seen such an error on IE9+? Is something wrong with the browser? Share your ideas, please. Thanks!
CustomExceptionAttribute whith $ajax POST call
I have this problem. I write a CustomExceptionAttribute that redirect on customerrorpage. My code work ok if I use a submit button on the MVC page and my controller throw an exception, but if my controller does same exception on ajax POST call, my custom error page not show. I see with Fiddler that my CustomExceptionAttribute return a view with custom error etc but browser non show this page. My code is: AJAX.CALL $.ajax({ url: '../Home/prova', type: 'POST',
Hide Dialog Buttons and Show Loading Animation
hi, I am using below code to diaply two buttons (Add to Basket and Cancel) on a dialog I want to hide both buttons when Add to Basket was clicked and display animated loading progress (loading.gif) Thanks, Jassim
How to hide a button in a row?
Hi, I am populating rows from MySQL and assigning a data-id to every row in order to allow user to delete the specific row. All are ok so far... Now, I want to hide the imgDelete for the choosen row only. I tried to hide() but it's hiding the imgDelete for all rows because all has the same name. Here is my row: <td data-id='" . $savanna_mysql_row["order_basket_item_guid"] . "' style='vertical-align: top; width: 25px; border-bottom: 1px solid black; padding: 10px; text-align: left;'><img class='linkDelete'
<body onload="load_jquery"> and declare function: how to ?
Hi, I'm quite new with JQuery and sometimes I've problems with syntax. Here is the actual code I have: <script type="text/javascript" src="includes/functions/jquery-1.4.2.min.js"></script> <script type="text/javascript" src="includes/functions/jquery.lightbox-0.5.min.js"> <script type="text/javascript"> $(function() { $('a.lightbox').lightBox(); // Select all links with lightbox class }); </script> ... <script type="text/javascript" src="includes/functions/bannerRotator.js"></script>
Recursive $.extend upon function call.
I want to recursively update the json file I have whenever I call a function. //Call up a function when hovered onto a selected html element. var i=0, j=1 function updateJSON(){ // Update the variables i++; j++ jdat = {"val":{"a":i, "b", j}} jdat = $.extend({jdat}, {}); } //Call the function three times, I should see this, updateJSON() // x3 times called output : {"val":{"a":1, "b":2}, "val":{"a":2, "b":3}, "val":{"a":3, "b":4} } // This doesn't happen, how can I do
Cannot Identify HTML5 main tag
I noticed that jquery 2.1.1 cannot detect the HTML5 main tag.
How to Upload Multiple File type Input in one Go?
I have 4 categories on my form. Each has 2 file type input. Here is an example of one: <div class="row"> <div class="file-field input-field col s6"> <div class="btn"> <span>MANILA</span> <input type="file" id="mnl_process"> </div> <div class="file-path-wrapper"> <input class="file-path validate" type="text">
AJAX why on first form doesnt redirects on second button redirects ?
I have this form here: <form id="voteUp" action="/minus-rep/{{$s->id}}" method="get"> <button type="submit" class="btn btn-primary"><i class="glyphicon glyphicon-thumbs-down"></i> <strong>Nerekomenduoti</strong></button> </form> And this is my jQuery code: $(document).ready(function(){ $("#voteUp").submit(function(evt){ evt.preventDefault(); var formData = $(this).serialize(); var url = $(this).attr("action"); $.get(url, formData, function(response){ $("#votes").html(response.newNumber); });
To hide a label and a textbox
I have a label and a textbox. I want to show or hide them by a condition. <li id="visitation"> <label for="lblVisitation" style="float: left;">Visitation ID: </label><input type="text" id="txtVisitation" style="float: left;" class="ui-state-default ui-corner-all" /> <div style="clear: both;"></div> </li> The JavaScript code: if (FacilityDefaults.UseDualVisitation) { $('label[for="lblVisitation"]').show(); $("#txtVisitation").show();
Puzzles on the length of the effect queue after a certain animation is finished
Hello guys, need ur help. jQuery version:2.1.4 example: <!DOCTYPE html> <html> <head> <style> div { margin:3px; width:40px; height:40px; position:absolute; left:0px; top:60px; background:green; display:none; } div.newcolor { background:blue; } p { color:red; } </style> <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script> <script> $(document).ready(function(){ var div = $("div"); function runIt() {
attr('checked', true) doesn't work on modal
Hello Jake; Onclick 2 things happen: 1 - I check a radio button which is inside a modal 2 - Open the modal that shows a list of radio buttons onclick="select_checked_radio('119', 'link'); open_direct_purchase_item_model('119', 'link', 6, 319,0)" The problem is that even though the source shows checked = "checked" but it is not checked in the modal. function select_checked_radio(item_id, p_type) { $('.profiles_checkboxes').attr('checked', false); if(item_id.length>0 && p_type.length>0)
If else statement in click event;
I want to get a random question from array, when the button firstly clicked the animation should be imlemented,all other times it just simply need to rewrite existing question with a new and random one. I thought the if/else statement should work here, but it doesn't. Here's my code: var clicked = false; var $feild=$('#questions'); var $screen=$('.container'); var $text=$() $screen.hide(); $('.button').click(function(){ if(!clicked){ $feild.text(get_question);
Next Page