[Solved] If text() equal do something [closed]

[ad_1] As a work around for this problem, you can use like this, var interval = setInterval(function() { if ($(‘.weatherCity’).length) { $(‘.weatherCity’).each(function() { if ($(this).text().trim() == ‘London’) { $(this).text(‘London Weather’); } }); clearInterval(interval); } }, 100); Fiddle Constantly checks for the element using setInterval and stop checking once it is found. [ad_2] solved If text() … Read more

[Solved] testing if a link is a youtube link.

[ad_1] Though it would be better to add a clear question to the question, I just noticed the comment in this line of the provided code: if(url.toLowerCase().indexOf(“youtube”) > 0) // this is where my function fails. You should check what var url = $(“#<%=txtYoutubeLink.ClientID %>”).val(); actually returns, because in case the url starts with youtube, … Read more

[Solved] how to add row in other table? [closed]

[ad_1] <!DOCTYPE html> <html> <head> <script src=”http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js”></script> <script> $(document).ready(function(){ $(“.button”).click(function(){ $(‘.child-table tr:last’).after(‘<tr></tr>’); }); }); </script> </head> <body> <table> <tr> <td><input class=”button” type=”button” value=”add”/></td> <td> <table class=”child-table”> <tr><td></td></tr> </table> </td> </tr> </table> </body> </html> 4 [ad_2] solved how to add row in other table? [closed]

[Solved] how to use jQuery on multiple pages

[ad_1] Right… I had found the downvotes strange… you guys almost gave me a sad birthday 😛 turns out the issue wasn’t understandable till you fall in the trap. Found the solution in one of these obscure web places 😉 Here you go: Somehow pages loaded into other pages through certain methods (ajax being one?) … Read more

[Solved] Dropdown menu effect [closed]

[ad_1] Pure css solution is CSS(3) transitions. http://jsfiddle.net/9gjbfvwy/ use width and height 0, with overflow hidden. Use CSS3 transitation to set them to auto. See fiddle (it’s your code, with 3 additions) ul.sub-menu{height:0;width:0;overflow:hidden;} .menu-item:hover ul.sub-menu{background:orange;width:200px;height:50px;} ul.sub-menu { -webkit-transition: all 0.3s ease-in-out; -moz-transition: all 0.3s ease-in-out; -o-transition: all 0.3s ease-in-out; transition: all 0.3s ease-in-out; } 3 … Read more

[Solved] Javascript – Looping and adding a class to an element [closed]

[ad_1] Here you go: http://jsfiddle.net/29Sby/1/ <style> .clicked{color:green; font-weight:bold;} </style> <a id=”link1″ href=”https://stackoverflow.com/questions/21706146/javascript:void(0); /*put URLs here if you need to*/” onclick=”doStuff(this)”>LINK 1</a><br/> <a id=”link2″ href=”javascript:void(0);” onclick=”doStuff(this)”>LINK 2</a><br/> <a id=”link3″ href=”javascript:void(0);” onclick=”doStuff(this)”>LINK 3</a><br/> <a id=”link4″ href=”javascript:void(0);” onclick=”doStuff(this)”>LINK 4</a><br/> <a id=”link5″ href=”javascript:void(0);” onclick=”doStuff(this)”>LINK 5</a><br/> <script> var counter = 0; doStuff=function(obj) { //alert(obj.id); if (obj.className === ‘clicked’) { //do … Read more

[Solved] What would be the $.ajax equivalent to this $.getJSON

[ad_1] Its clear in Official Docs jQuery.getJSON() $.ajax({ dataType: “json”, url: “http://confidential.com/pcm/datamobile.asmx/ObtenerContactos”, data: {sessionId: 1}, success: function(data) { alert(“Success!!! yay”); peopleList = data; jsonIsLoaded();//output your data to console } }); 1 [ad_2] solved What would be the $.ajax equivalent to this $.getJSON

[Solved] time and date validation in javascript [closed]

[ad_1] I have done a workaround for you to achieve what you have said <input type=”text” value=”Enter date!” id=”dte” class=”datepicker”> <br/> <br/> <input type=”text” id=”time” value=” time!” > $(“.datepicker”).datepicker({dateFormat: “yy-mm-dd”}); $(“input.datepicker”).on(“keyup change”, function(){ var today = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate()).getTime(); var d = new Date(); var month = d.getMonth()+1; var day = … Read more