capturing an anchor tag inside div tags
how do i do that with this code $(document).ready(function() { $('a').click(function(){ alert($(this).text()); alert($(this).attr('href')); return false; }); }); which work if the anchors are just like <a href="/test1">---1---</a> <a href="/test2">---2---</a> <a href="/test3">---3---</a> if they are embedded in div they do not work <div style=display:table; class="clsMenu" id="divMenuSystem"> <div style=margin:0,0,0,0;> <a href="/Eureka/Home.aspx" target="_parent" onClick="closeAllSubMenus();"">Home</a>
How to set the return color value (Getter .css) on a different map than rgb space????
Hello, I am trying to get the value .css("background-color") in this example: http://jsfiddle.net/ybLGX/ but it seems that the only colorspace retrieved is rgb, is there a way of getting such a value in hsl??? Thanks in advance for any help.
Selecting specified div when clicking it
Hi, I am trying to make a functional dynamic jquery selection but it seems impossible for me. Here is the code: $('.schools').eq(0).toggle(function(){ $('.big_schools').eq(0).fadeIn('slow'); $('.big_schools').eq(1).fadeOut('slow'); $('.big_schools').eq(2).fadeOut('slow'); }, function(){ $('.big_schools').eq(0).fadeOut('slow'); }); $('.schools').eq(1).toggle(function(){ $('.big_schools').eq(1).fadeIn('slow'); $('.big_schools').eq(0).fadeOut('slow'); $('.big_schools').eq(2).fadeOut('slow'); }, function(){
toggling existing html markup, how can i do a function?
Hello, i use this piece of code to show/hide actual markup in a web page, but i want to do some function so when i call and pass a parameter it automatically sets the resulting behaviour. the thing is that i am new at jquery jQuery(document).ready(function($) { $('.intertop ul.ultop .loginform a.login').click(function() { if ($(this).hasClass('activo')) { $(this).removeClass('activo').addClass('inactive'); $("#login-form").fadeOut().removeClass('activo');
Getting inner HTML using "this"
Hey Guys. I'm a little new to jQuery. I'm currently trying to retrieve the contents of an inner html by using the "this" function. I have tried using it with the code below, but it doesn't seem to be working.. Do you guys have any suggestions? Thanks! $("#change_order_time").click(function(){ console.log($("#order_time").this.html()); // Looking to get the inner contents of "#order_time" });
Populate hidden list into html elements
have few hidden fields which should become visible on click of a link. Below is the html code <table> <thead> <tr><th></th></tr> </thead> <tbody> <tr> <td align="center"> <span id="hoverspan"> <a href="#" onclick="DisplaySelectedPart('1')"><label id="internalNumber">121334</label></a></span> <input type="hidden" name="shipmentDetails.lineItems.part.mfgNumber" value="345245" id="part.mfgNumber1"/> <input type="hidden" name="shipmentDetails.lineItems.part.description" value="red and blue chicken sweaters
Textarea with numbered lines
I'm looking to add the line number for each line to the left of the textarea box. I would have thought that finding a solution to this would have been easy but it seems that all of the examples I've found on the internet are outdated and not working properly. Can anyone help me out with this by providing me with a current, working example? Thanks!!
How to set correct context of $(this) within anonymous function called by event
I would like to access the ID attribute of an element selected within the click event of another object. The code below shows the ID for the #button but i want the ID for the .a class element. I think I need to use proxy but I could use some guidance. Thanks in advance. $(document).ready( $(function () { $('#button').on('click', function () { $(".a").append("<p>ID:" + $(this).attr("id") + "</p>"); }); })); Example: http://jsfiddle.net/9937c/6/
Show Hide Text
Hey Guys. I am trying to hide text when a with a click event. For some reason it hides the text and within a fraction of a second the text re-appears. I am not sure why this is happening.... Can anyone please help? Below is my code. Thanks you jquery code $("#change_order_time").click(function(){ $("#order_time").hide(); HTML code Delivery Time - <span id="order_time">TODAY, ASAP</span> <a href id='change_order_time'> Change order time </a> <br>
having problems doing my first example on jQuery
Hi i am kash I have started learning how to use jQuery. i have been using the book jQuery for dummies. But i have encounted my first problem doing the first exercise. This is the code i used: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtm11/DTD/xhtm11-strict.dtd"> <html> <head> <title>My Test Page</title> <script type="text/javascript" src="js/jquery-1.11.0.js"></script> <script type="text/javascript"> $(document).ready(function(){ alert(jQuery('img').attr('alt'));
refreshing a div on button click...
Hi, How to refresh a div on button click example, <div id="refresh "> <button onclick="refresh() ">click</button> </div> <script> refresh() { //code to refresh the div } </div>
.load Function ... within .load function
My page utilises an AJAX .load function to load divs from a separate .html file into a target div on my page. Here is my AJAX code: $(document).ready(function(){ $("#about2").click(function() { $("#content").load("content.html #about", function() { $.getScript("slides.js", function() { $(window).scrollTop(0); }); }); }); $("#process2").click(function(){ $("#content").load("content.html #process", function() { $(window).scrollTop(0); }); }); $("#materials2").click(function(){ $("#content").load("content.html
JSON Array Loading
I have a very simple module where I want to load my preferences from a database into the input boxes of a form. The $.getJSON seems to work fine in that it returns the following... [{"pref_ID":1,"pref_CoName":"WK Design Group","pref_CoAddress":"351 California Street, Suite 3","pref_CoCity":"San Francisco","pref_CoState":"CA","pref_ZipCode":"94104","pref_Phone":"415-537-9400","pref_Fax":"415-863-4209","pref_FormNum":"WKdg Form 1-1","pref_FormDate":"2000-03-20","pref_FormComment":"A 1.5% per month
Ajax, popstate
Hello, I know this not exacly strick forum for this type of problem but maybe some1 will help me. I was looking around for some time into example made by Sebastian Sulinki here' demo - http://html5-history-pushstate.ssdtutorials.com/ It is perfect, but it seems that `window.onpopstate = function(){` does not work on document ready or window load in firefox and interner explorer 11 and 10 It does trigger on other browsers. I can't demonstrate in on my server because it wont work(demo) on not domain
SVG animation and firefox
I'm struggle with SVG animation drawing, which is work perfectly on all browsers (even IE has no problems with that), only firefox not drawing correctly Script it self work on all modern browsers Script took from -http://tympanus.net/Development/SVGDrawingAnimation/ But when I generate SVG code from vector image it does not work on firefox Example http://codepen.io/SzymonDziewonski/pen/agcxs/ It is 100% svg path issue, something with code. But what?
Can I use jQuery to show random text?
I apologize in advance that I don't know much about any of this. I have an order form I created with CoffeeCup Web Form Builder. The CoffeeCup community has been no help. Upon submission of the form, myself & the customer get an email that shows the results of the form submission. The program has an email configuration page that uses html to design the way the emails will look and I can have the email show any element that was filled out or selected from the form. But only "input elements". The
$ is not defined please help me...?
i have javascrit.js file it contains code like below I have jquery.js file also included in correct path but it shows $ not defined in document.ready function document.write('<script src="jquery.js" TYPE="text/javascript"></script>'); $(document).ready(function(){ $('#bordercou').click(function() { alert("hai"); }); });
addClass not working in IE
Internet Explorer 11 (possibly other versions) ignores the first application of .addClass() if the target element: is one of the following inline elements: label, strong, span, em contains an input element (any type) contains text within another inline element such as: label, strong, span, em It behaves properly in other browsers. http://jsfiddle.net/r6SVH/2/
Cross-domain Ajax (CORS)
Hey guys, I've seen many tutorials and several posts here on jQuery but no one could help me. I'm trying to get a JSON response from http://findconcertsservice.cloudapp.net/FindConcertsService.svc/help/operations/findAll but somehow is not possible .... I'm using some code I found on internet. makeCorsRequest('http://findconcertsservice.cloudapp.net/FindConcertsService.svc/help/operations/findAll', 'GET');This is my function: // Create the XHR object. function createCORSRequest(method, url)
Replace Text
Hi All, I have this text : See More <a href = "#">Click</a><img src = "#"/> now I wanna create some thing which can convert this text to this : See More <a href = "#">Click</a><img src = "#"/> changes < and > in href link to < and > but there is no changing for img tag Thank you
parentElement.removeNode is not working in FireFox
Hi All, I am facing another strange issue in multi browser platform FireFox browser The below code is working fine in IE 10 p_objObject.parentElement.parentElement.removeNode(true); $("#_strContDiv" + p_objObject.parentElement.parentElement.FilterID).remove(); The above code is not working in firefox, Please provide your suggestion
Jquery, AJAX and JSON
Hello All, I have been able to execute AJAX and JSON successfully in the past however I am struggling with the following JSON and not sure what I am doing wrong. For the given JSON { "invoices": { "INV123589": { "custname": "Customer A", "total": "$100" }, "INV123554": { "custname": "Customer B", "total": "$200" } } } I am trying to parse it via an ajax call: $.ajax({ url: 'someurl', type: 'GET', dataType: 'json', success:
Replace pictures
I've developed a menu with little pictures in each <ul>: <div> <img class="one" src="hat.jpg"> <img class="two" src="coat.jpg"> <img class="three" src="children.jpg"> <img class="four" src="shirt.jpg"> <ul> <a href="#"><li class="selector" id="one">Hats</li></a> <a href="#"><li class="selector" id="two">Coats</li></a>
selectnodes not working on firefox
Hi, Below code is not working in firefox xmlNodes = xmlDoc.selectNodes(elementPath); Thanks, Sabari.A
JQuery Not Working in FireFox Browser
Hi, I have button in aspx page, with loading CSS dynamically using Jquery, the button is able click in IE version (10 & 9) but in FireFox unable to click the button. kindly provide your assistance on the above issue Thanks, SH
Show alert when one div has been clicked but another has not.
Hey all! Hopefully this is possible and someone can help. Basically, I have created a package Sign Up form, so users can select which features of the package they want to include, see the price and then sign up for the package. The user picks their choices from drop down select boxes, presses an Add button to increase the packages price and then once happy, they can click Sign Up to submit. What I need to have happen is if a user uses the dropdown, selects an option, but does not click add, they
mouseenter/mouseleave variable question
Hi I have a menu which displays text for each link (e.g. Link 1, Link 2, Link 3 etc) and when I hover over the link, I change the text of the link for an image. The image is different for each link so i have so far got the first part working where the text changes for the image but I need to get th eimage to change back to the text when i "mouseleave". When I "mouseleave" on my function below, it breaks indicating that "whichone" and "originaltext" variables do not exist. Can you help fix my problem?
problem with drop down on scroll...it is delaying
pls see the fiddle....when we scroll down animation on header is perfect but when we scroll up to $(document).scrollTop to "0" is needs to come to its normal position. http://jsfiddle.net/e4Rk5/1/
On pint click text boxes goes blank.
Hi, I have a page in which i use this code. <script type="text/javascript"> function PrintDiv() { var printarea = document.getElementById('estimat_print'); //var popupWin = window.open('', '_blank', 'width=870,height=2200'); var popupWin = window.open('', '_blank', 'width=720'); popupWin.document.open(); popupWin.document.write('<html><body onload="window.print()">' + printarea.innerHTML + '</html>'); popupWin.document.close(); } </script> to print a particular <DIV> but when i clicking print button.
,but the problem is ,I have to send the arrays of values data to the Spring controller ,trough ajax ,Here I am Strucked Up...
$("#form1").submit(function(event) { alert("Thank you for your comment!"); //event.preventDefault(); $.ajax({ type : "GET", traditional: true, url : "/security/twelvehrspattern.html", data : "empidlist="+empidlist+"&empnamelist="+empnamelist+"&noofduties="+noofduties, contentType: "application/json; charset=utf-8", success
Replace All String But Not An Especially Tag
Hi, I have a div tag which I can write some thing in it and if I write some thing which contains a tag it will save in my database and after load it will run, but I don't wanna run some tags, so I know have to replace < > with < and > but not an img tag which its class name is MyImg cause this tag inserted by my code. its kinda security for my website because perhaps someone write refresh html tag and after load from database that tag will refresh my website.
Know the event on postback
Hi I have a gridview with paging enabled. I am handling beforeunload from clientside wherein i am calling a code behind function. When i click on page number the page gets unloaded . Is there a way to know that page index was changed or something like that on postback and prevent that function call from client side. Thanking you in advance.
Only allow one checkbox to be checked, then display checked value
Please check: http://jsfiddle.net/lluuccaass/8B73p/ as you can see the checkbox function works perfectly. But there seems to be a problem with the callback function after checking more than one checkbox. Only one value should be displayed. I don't get the problem. I would really appreciate your help. Thanks a lot
Implement .GetScript function into current AJAX script.
My page uses an AJAX script that dynamically loads content into my content DIV from a separate HTML page "content.html". The problem i am facing again and again however is that if the content contains any form of script, for instance my slideshow JQuery Plugin or my dynamic tabs plugin it simply won't work. My site is: http://www.crookedcartoon.co.uk/print.html I'm currently looking into the .GetScript function and am wondering how to implement it into my current AJAX code For example, my AJAX code
jQuery licencing on commercial sites
I understand that any modified or derivative works are also MIT or GPL, however, if jQuery is called from a webpage on a commercial site, is the HTML that it is called from now a derivative work, and hence all the copyrighted content within is now also GPL or MIT? What I'm trying to say is if jQuery is used on a commercial webpage, does the owner of the page now relinquish the copyrighted content of the page or site to the open license? Thanks in anticipation. WB
Problem with national characters in cookies.
Hello, I'm having French accent problems with values put in cookies when using JQUERY/AJAX. Below are my samples. In fact, I'm testing a "town name" which contains a French accentued letter. 1. I create Cookie TEST1 in test1.php , If I read the cookie TEST1 from the same procedure the town name displays correctly. 2. Then I click on the button, to trigger a JQUERY function which creates a new cookie : TEST2 from the value found in TEST1. 3. I start AJAX to call a second procedure
how to get the all search string from given string?
How to get the all string names when string starts with "{!" and ends with "}" in the given string. My code: <span>Hi {!LastName},Welcome to All. Testttttt character testing.{!LastName1}{!LastName2},{!LastName3},{!LastName4},{!LastName5}{!LastName6},Welcome to All{!!LastName7}</span> In the above code how to get this all string contains "{!.......}"(it will returs {!LastName},{!LastName2},{!LastName3},{!LastName4},{!LastName5},{!LastName6},{!LastName7}) the string contains {!!LastName} it won't
whenever i click add record record has to display in table format and store the values in corresponding arrays !!,values are storing in arrays ,records are diplaying in table format in same jsp
var empidlist =[]; var empnamelist =[]; var dutieslist =[]; function doAjaxPost() { alert("we are in ajax do post method"); var empid = $('#emp_id').val(); empidlist.push(empid); var ename = $('#txtHint1').html(); empnamelist.push(ename); var noofduties = $('#noofduties').val(); dutieslist.push(noofduties); $(document).ready(function(){ $("#form1").submit(function(event) { alert("Thank you for your comment!");
I am getting the problem whilw posting the arrays of values to the sping controller ...but i am getting error response..please Help anyone ..thank in advance
$(document).ready(function(){ $("#form1").submit(function(event) { alert("Thank you for your comment!"); //event.preventDefault(); $.ajax({ type : "GET", traditional: true, url : "/security/twelvehrspattern.html", data : "empidlist="+empidlist+"&empnamelist="+empnamelist+"&noofduties="+noofduties, contentType: "application/json;
datepicker, click event
Hello, I have the code below (datepicker) which works if its within the same file but if its pulled in from an external js file its wont work. My strength isn't in Jquery or javascript and I'm hoping someone here can help. I have a feeling it has something to do with the click event but not sure how to implement the event. $(function() { $("#datepicker").datepicker ({ showButtonPanel: true, minDate: '0M', maxDate: '+90D', dateFormat: 'yy-mm-dd', showButtonPanel:
Next Page