Search Results

Search found 4827 results on 194 pages for 'alert'.

Page 63/194 | < Previous Page | 59 60 61 62 63 64 65 66 67 68 69 70  | Next Page >

  • jquery dynamically added checkbox not working with change() function

    - by estern
    I dynamically load in a few li's that have a label and a checkbox in them to another visible ul. I set the checkboxes to be checked="checked" and i am trying to trigger an event to happen when i change these dynamically inserted checkboxes but nothing occurs. Here is the jquery: $(".otherProductCheckbox:checkbox").change( function(){ alert('test'); }); Here is the html for the dynamically added li's: <li class="otherProduct"><input type="checkbox" class="otherProductCheckbox radioCheck" checked="checked"/><label>Product Name</label></li> Any idea why i cant get the alert to happen when the checkbox changes its checked state?

    Read the article

  • element height after content change

    - by Neph
    I have a snippet of code that alters the contents of a DIV to match the contents of a textarea and then applies the height change in the DIV to the textarea element. function growTextArea(parameter) { $('div').find("[data-fieldid='1_description']").text($(parameter).val()); // No Works height = $('.hiddenDiv').find("[data-fieldid='1_description']").outerHeight(); alert(height); // Works heightDiv = $('.hiddenDiv').outerHeight(); alert(heightDiv); $(parameter).css('height', $('div').find("[data-fieldid='1_description']").outerHeight()); } The DIV contents change properly, so the search function is working properly, however the search function always returns the original height of the DIV. The function is called by onKeyUp in the textarea. If the .find is swapped out for a .hiddenDiv the height change is reflected properly.

    Read the article

  • Actionscript / Flex: a question about handleAllEvents() method.

    - by Patrick
    Hi, in Adobe tutorials, they suggest to create a class to handle the events (see below the copy/pasted code, and link to page). I was wondering if I have to handle all events with the function handleAllEvents, using if statements to check if the target is the one I want, and the event is the one I want. i.e. if (event.type=="click") && (event.currentTarget == "myId") Should I have a list of ifs (for each target and each event type ?) thanks // events/MyStaticEventHandler.as package { // Empty package. import flash.events.Event; import mx.controls.Alert; public class MyStaticEventHandler { public function MyStaticEventHandler() { // Empty constructor. } public static function handleAllEvents(event:Event):void { Alert.show("Some event happened."); } } } Link (at the bottom): http://livedocs.adobe.com/flex/3/html/help.html?content=events_05.html

    Read the article

  • Access to Label value with Javascript

    - by streetparade
    I need to access to a value in a checkbox, the atribute value has content, so i need to place the id somewhere else i created a label, but i have not access to that value alert(check[i].label); // doesnt work where else can i place a value in checkbox. Please dont write that i can do this <input type='checkbox' id='bla' name='mybla' vlaue='myvalue'> Hy Where can i place some other values ? I tryed with this <input type='checkbox' id='bla' name='mybla' vlaue='myvalue' label='myothervalue'> Hy first i get all checkbox ect... and in the for loop i did this alert(check[i].label); // doesnt work How can i do that?

    Read the article

  • handing data returned from jquery get request

    - by ian
    I have a simple jquery script as follows: $('a').click(function() { //get the id of the song we want to play var song_id = $(this).attr("id"); //do a get request to get the information about the song $.get("http://www.site.com/v4/ajax/get_song_info.php", { id: song_id, }, function(data) { alert("Data Loaded: " + data); }); //alert( song_id ); }); I have gotten it to work and it returns several bits of data 'artist' 'title' 'song duration' and so on. How do I process my 'data' so I can then update my page with each bit. In this case I want to set a series of '' to hold each of the values returned. Thanks.

    Read the article

  • jsonp callback error and parserror

    - by Fatima Zahrae Abbadi
    im devlopping web app with javascript/html5 client side and im using web service rest in the server i want to get json data from the server and i have problem of cross domain and i use JSONP the problme that i had the callback was not called this is the code of REST @GET @Path("agenda") @Produces({MediaType.APPLICATION_JSON}) public List<AgendaChambre> getAgenda() { ArrayList<AgendaChambre>list=new ArrayList<>(); return agenda.findAll(); } and function getdata(){ $.ajax({ type: "GET", dataType:"jsonp", crossDomain: true, url: "http://localhost:8080/wsccm/res/ws/agenda?jsoncallback=?", data: {name: "George Koch"}, jsonpCallback: 'successCallback', success: function(data1) { getdata=JSON.stringify(data1); alert("bieeeeeeeeeeeeeeeeen"); console.log("response:" + getdata); }, error: function(jqXHR, textStatus, errorThrown) { alert('error'+errorThrown); console.log(jqXHR); } });

    Read the article

  • Is there any declare for toggle() that if its open do this, closed to that?

    - by Dejan.S
    Im doing some jquery stuff with toggle(), I'm doing different actions depending on if the current div is closing or showing, i know i can easy check if a div hasClass() or is(':visible') for what i want to do, but I'm thinking maybe there is somehow that i can reduce the amount of code or just do it more efficient? like declare the toggle() with two functions that this is for when its showing and this is for when its closing, is this possible? hope you get what i mean? like this, or check a jsfiddle $('#click_me').on('click', function() { $('#contain').toogle('blind', 300, function (){ alert('open'); }, function (){ alert('close'); }); });

    Read the article

  • Getting a drop down box value with javascript?

    - by ritch
    I'm trying to get the value currently selected and I simply want to alert it. I current have this: <script type="text/javascript"> alert(forms.elements('sets').value); </script> HTML: <form> <select name="sets"> <option value="1">1 Set</option> <option value="2">2 Sets</option> <option value="F">3 Sets</option> </select> </form>

    Read the article

  • Access PHP var from external javascript file

    - by FFish
    I can access a PHP var with Javascript like this: <?php $fruit = "apple"; $color = "red"; ?> <script type="text/javascript"> alert("fruit: " + "<?php echo $fruit; ?>"); // or shortcut "<?= $fruit ?>" </script> But what if I want to use an external JS file: <script type="text/javascript" src="externaljs.js"></script> externaljs.js: alert("color: " + "<?php echo $color; ?>");

    Read the article

  • Unable to send an associative array in JSON format in Zend to client

    - by Anorflame
    Hi, In one of my actions in a controller, I'm using the json view helper to send back a response to an ajax request. On the client side I alert the data that is passed to the success callback function. It works fine as long as the response is a number or an array with default keys. Once I try to send an associative array, it alerts with [object Object]. Server code: $childArray = array('key'=>'value'); $this->_helper->json($childArray); javascript: function displayChildren(data){ alert(data); } ... $.ajax({ url: "/po/add", dataType: "json", data: {format: "json"}, success: displayChildren }); I have no idea what am I doing wrong here, so any help would be appreciated...

    Read the article

  • Create JavaScript array of function pointer, without calling it

    - by sibidiba
    I have the code below. I would like to have an array (buttons) with a single element pointing to the a function (closeFlag). <script type="text/javascript"> var closeFlag = new function() { alert('Clicked'); } var buttons = { 'OK': closeFlag } </script> However, when loading the page the alert immediately pops up. When the array is constructed, instead of using it as a pointer, JavaScript calls my function. Why? What mistake, misconception do I have?

    Read the article

  • Problem with $.get while submitting form

    - by bradenkeith
    I'm trying to verify that an Account Name is not already in use once a user fills out a form. The code looks like: $("#add_account").submit( function () { $.get( "'.url::site("ajax/check_account_name").'", {account_name: "t"}, function(data){ alert( data ); }); }); I get a $.get response if the statement sits like this: $(document).ready( function () { $.get( "'.url::site("ajax/check_account_name").'", {account_name: "t"}, function(data){ alert( data ); }); }); Which leads me to believe that my $.get statement is correct. Is there some jQuery rule I'm not familiar with that would cause this to fail in on submit scenario? In code block 1, I get values returned like they should. Block 2 gives me a blank response. Any ideas? Thanks for your time, I know you have better things to be doing.

    Read the article

  • When will [MFMailComposeViewController canSendMail] return NO

    - by pythonquick
    M iPhone app is using the MFMailComposeViewController class to send an in-app email with an attachment. The app will only attempt to display the mail composer dialog if the "canSendMail" method of class MFMailComposeViewController returns true (YES). Specifically, if the following method returns YES, it shows the mail composer, otherwise the user is presented with an error alert dialog stating that there are no email accounts set up on the device: - (BOOL)canDeviceSendEmail { Class mailClass = (NSClassFromString(@"MFMailComposeViewController")); return mailClass != nil && [mailClass canSendMail]; } A team of testers have reported that they get this error alert dialog, even when email accounts are set up on the device. The tester used an iPhone 3G with OS 3.1.3. Therefore the MFMailComposeViewController class must have existed, and the "canSendMail" method must have returned NO. My question is therefore: apart from the case when there are no email accounts set up on the device, in what other circumstances can the "canSendMail" method return NO? ~ Thanks

    Read the article

  • jquery.post() not working

    - by Sarang
    Hello everyone, I am trying to fetch xml file using jquery.post() method. My code is : function getTitle() { jQuery.ajax({ type: "GET", url: "https://spreadsheets.google.com/feeds/spreadsheets/private/full.txt", dataType: "xml", success: function(xml) { var i=0; $(xml).find('entry').each(function(){ if($(this).find('title').text().toString() == "Sample Spreadsheet"){ var href = $(this).find('link')[1].getAttribute('href').toString(); var url="https://spreadsheets.google.com/feeds/worksheets/" + href.split('=')[1] + "/private/full"; alert(href.split('=')[1]); } i++; }); } }); } But, it is not giving me alert ! How do I solve ?

    Read the article

  • How to check that this event would occur after DOM is ready in jquery ?

    - by Rachel
    I want to get page_tag information from the page and want to make sure that DOM for this page is already ready before getting the page tag information. I am doing $(document).ready( { alert("test"); var page_tag : $("head meta[name='page_tag']").attr('content'); page_tag : (page_tag) ? page_tag : ''; } But it gives me errors, missing : after property id alert("Check if document is ready");\n Any suggestions on what could be the possible reasons for it or any other way of checking if the dom is ready or not before getting page_tag information.

    Read the article

  • GM_xmlhttpRequest inside unsafeWindow

    - by streetparade
    Hy, i need the content of a web page, in greasemonkey. i wrote a function like this. unsafeWindow.testpage = function() { GM_xmlhttpRequest( { method: "GET", url: "http://www.test.com/xml/xml.php", headers: { "User-Agent": "Mozilla/5.0", "Accept": "text/xml" }, onload: function(response) { alert(response.responseText); } }); } If i execute the above it just logs that GM_xmlhttpRequest cannot be executed inside a unsafewindow. How can i get the content of http://www.test.com/xml/xml.php in a unsafe window? What i expect is that the content of http://www.test.com/xml/xml.php is returned in alert box How can i do that?

    Read the article

  • Jquery to slide on load

    - by Pexsol
    I have a simple slider that works on click. How can I automate it so it runs automatically yet keeping the click function as it is? $(document).ready(function() { var currentPosition = 0; var slideHeight = 360; var slides = $('.main-item'); var numberOfSlides = slides.length; var tracker = 0; $('.slider-height').css('height', slideHeight * numberOfSlides); $('.slide-option li a').click(function() { tracker = $('.slide-option li a').index($(this)); $('.slide-option li a').removeClass('current-item'); $(this).addClass('current-item'); //alert(tracker); $('.slider-height').animate({ 'top': slideHeight * (-tracker) }); return false; //alert(tracker); }); });

    Read the article

  • jQuery - add onclick to TR

    - by Guus
    I use Richfaces and one of the rich:dataTable generates this html: <form id="scheduleForm"> <table id="scheduleForm:rowList"> <tr> <td></td> </tr> </table> </form> I want to act on a click on a TR for this table. How can I do this? The following also works for other tables on the page and I get the alert() for the other rows as well, and I don't want that. jQuery('#scheduleForm:rowList tr').click(function(event) { alert(1); });

    Read the article

  • jQuery: Quick question. How to select string variable?

    - by user317563
    Hello world, EDIT: I would like to avoid doing something like this: var str = 'Hello'; if ( str == 'Hello') { alert(str); } I would rather do: var str = 'Hello'; $(str).filter(':contains("Hello")').each(function(){ alert(this) }); I've tried a lot of things: $(str).text().method1().method2().method3(); $(str).val().method1().method2().method3(); $(str).contents().method1().method2().method3(); Nothing worked. Is it possible to do this? Thank you for your time. Kind regards, Marius

    Read the article

  • AJAX with jQuery not returning data

    - by James P
    This is my Javascript: $(document).ready(function() { $('#like').bind('keydown', function(e) { if(e.keyCode == 13) { var likeMsg = $('#like').val(); if(likeMsg) { // Send the AJAX request to like.php $.ajax({ url: 'like.php', success: function(data) { alert('Content: ' + data); } }); } } }); }); And this is my like.php file: <?php echo "It works! :)"; ?> When I press enter on the #like input, it seems the AJAX request is sent and an alert box comes up saying: Content:, but there's no data being sent back from like.php... I have checked if the file exists and if it's in the same directory and whatever and it is, so I'm pretty much clueless atm. Does anyone know what could be wrong here? Cheers.

    Read the article

  • focus() jQuery function doesn't work in Safari, but works fine on all other browsers?

    - by pMan
    I have a search text field and search button, when button is clicked with default text in text field, or null value, an alert pops up and sets focus back on search text field. This works very well on all major browsers but not in safari. I tried it even with out jquery, but didn't work. When the focus falls on search text field, I have another jQuery function, is that the problem. The code that sets focus on search text is: if (defaults.keyword == SEARCH_TIP || defaults.keyword == '') { alert(SEARCH_NULL); $('#store_search_keyword').focus(); return false; } The code on focus is: var search_dom = $('#store_search_keyword'); var search_text = search_dom.val(); search_dom.focus(function(){ if ($(this).val() === SEARCH_TIP) { $(this).val(''); } }); any help is appreciated, thanks..

    Read the article

  • ajax how to read out $_post variable

    - by alex
    Hi, I am trying to filter/search a database with ajax $.ajax({ type: "POST", url: "filterSearch.php", queryString: qry, success: function(data){ alert( "Data Saved: " + data ); $('#searchResult').html(data); // Fill the search results box } }); Now in filterSearch.php i have the following test codes if(isset($_POST['queryString'])) { echo "TEST"; } if($_POST['runquery']==1) { $sql = "SELECT * FROM fs_vacatures WHERE here-the-like-query?"; $msg = $sql; echo $msg; die(); } die(); But nor TEST or the $sql is return in the alert??

    Read the article

  • textarea into array javascript

    - by user281180
    myList contains the following values: value1 value2 value3 function showArray() { var txt = $("#myList").text(); var textread = txt.split('\n'); var msg = ""; for (var i = 0; i < textread .length; i++) { msg += i + ": " + textread [i] + "\n"; } alert(msg); } my alert gives me the following: 0:value1 value2 value3 It`s not what I wanted and expecting, I was expecting something like: 0: value1 1: value2 2: value3 How can I get the values as expected?

    Read the article

  • Does jQuery.on() work for elements that are added after the event handler is created?

    - by orokusaki
    I was under the impression all this time that .on() worked like .live() with regards to dynamically created elements (e.g. I use $('.foo').on('click', function(){alert('click')}); and then an element with the class foo is created due to some AJAX, now I'm expecting a click on that element to cause an alert). In practice, these weren't the results I got. I could be making a mistake, but could somebody help me understand the new way to achieve these results, in the wake of .on()? Thanks in advance.

    Read the article

  • I can get access to object's properties if method is called from anonymous function, but I can't do

    - by Kirzilla
    Hello, $.Comment = function() { this.alertme = "Alert!"; } $.Comment.prototype.send = function() { var self = this; $.post( self.url, { 'somedata' : self.somedata }, function(data) { //using anonymous function to call object's method self.callback(data); } ); } $.Comment.prototype.callback = function(data) { alert(this.alertme); } This code works great when I'm calling $.Comment.send(), but this code won't work... $.Comment.prototype.send = function() { var self = this; $.post( self.url, { 'somedata' : self.somedata }, self.callback //using direct access to method ); } Please, could you explain me why? Thank you

    Read the article

< Previous Page | 59 60 61 62 63 64 65 66 67 68 69 70  | Next Page >