Search Results

Search found 10381 results on 416 pages for 'delegate and events'.

Page 101/416 | < Previous Page | 97 98 99 100 101 102 103 104 105 106 107 108  | Next Page >

  • backbone model validation error

    - by koko
    I got a validation based on backbone fundamentals by addyosmani, but when i try it on my view i can't get the error that the model generated.TIA model.js validate: function(attrs) { var errors = this.errors = {}; if (!attrs.box) errors.box= 'box value is required'; //console.log(errors.box); if (!_.isEmpty(errors)) return errors; } view.js validate: function(model) { console.log("error text--" + model.errors[this.input] || ''); },

    Read the article

  • How do I stop a routed event from triggering on specific places in XAML?

    - by cfouche
    I have the following situation: A stackpanel contains a number of elements, including some that are contained in a GroupBox. So something like this: <StackPanel x:Name="stackpanel" Background="White"> <TextBlock Text="TextBlock"/> <TextBlock Text="Another TextBlock"/> <!--plus a load of other elements and controls--> <GroupBox Header="GroupBoxHeader"> <TextBlock Text="Text inside GroupBox"/> </GroupBox> </StackPanel> I want a MouseDown in the stackpanel to trigger some Storyboard, so I've added an EventTrigger, like this: <EventTrigger RoutedEvent="Mouse.MouseDown" SourceName="stackpanel"> <BeginStoryboard Storyboard="{StaticResource OnMouseDown1}"/> </EventTrigger> This is almost right, but the thing is - I don't want the MouseDown to be picked up by the GroupBox's header or border, only by its content. In other words, I want the Storyboard to begin when someone does a mousedown on anything inside the StackPanel, except GroupBox headers and borders. Is there some way of doing this? (I've tried setting e.Handled to true on the GroupBox, but then its content doesn't pick up the mousedown anymore either.)

    Read the article

  • Back button causes iFrame to delay window.onLoad event

    - by JoJo
    I serve ads through an iFrame. The ad network's servers are much slower than mine, so I asyncronously load the iFrame after the window.onLoad event. Event.observe( window, 'load', function() { $('ad').writeAttribute('ad.html'); } ); A problem occurs when you enter the site via the browser's back button. Unexpectedly, the ad iFrame attempts to load immediately, delaying window.onLoad for a few seconds. During these few seconds, the site is unusable because I do a bunch of initialization after window.onLoad. As far as I know, this only happens in Firefox. How do I prevent this blocking load?

    Read the article

  • Why use event listeners over function calls?

    - by Organiccat
    I've been studying event listeners lately and I think I've finally gotten them down. Basically, they are functions that are called on another object's method. My question is, why create an event listener when calling the function will work just fine? Example, I want to call player.display_health(), and when this is fired, the method player.get_health() should be fired and stored so that display_health() has access to it. Why should I use an event listener over simply calling the function? Even if display_health() were in another object, this still doesn't appear to be a problem to me. If you have another example that fits the usage better, please let me know. Perhaps particular languages don't benefit from it as much? (Javascript, PHP, ASP?)

    Read the article

  • LearnBoost's Socket.IO-Node why onClientMessage not work

    - by KingPin
    Hi, all, I tried to put the module "LearnBoost's Socket.IO-Node", all works, except event 'onClientMessage' Tell, in what there can be a problem, thanks! ...sorry for my english io.listen(server, { onClientConnect: function(client){ client.send(json({ buffer: buffer })); client.broadcast(json({ announcement: client.sessionId + ' connected' })); }, onClientDisconnect: function(client){ client.broadcast(json({ announcement: client.sessionId + ' disconnected' })); }, onClientMessage: function(message, client){ var msg = { mess: [client.sessionId, message] }; buffer.push(msg); if (buffer.length > 15) { buffer.shift(); } client.broadcast(json(msg)); }

    Read the article

  • Event type property lost in IE-8

    - by Channel72
    I've noticed a strange Javascript error which only seems to happen on Internet Explorer 8. Basically, on IE-8 if you have an event handler function which captures the event object in a closure, the event "type" property seems to become invalidated from within the closure. Here's a simple code snippet which reproduces the error: <html> <head> <script type = "text/javascript"> function handleClickEvent(ev) { ev = (ev || window.event); alert(ev.type); window.setTimeout(function() { alert(ev.type); // Causes error on IE-8 }, 20); } function foo() { var query = document.getElementById("query"); query.onclick = handleClickEvent; } </script> </head> <body> <input id = "query" type = "submit"> <script type = "text/javascript"> foo(); </script> </body> </html> So basically, what happens here is that within the handleClickEvent function, we have the event object ev. We call alert(ev.type) and we see the event type is "click". So far, so good. But then when we capture the event object in a closure, and then call alert(ev.type) again from within the closure, now all of a sudden Internet Explorer 8 errors, saying "Member not found" because of the expression ev.type. It seems as though the type property of the event object is mysteriously gone after we capture the event object in a closure. I tested this code snippet on Firefox, Safari and Chrome, and none of them report an error condition. But in IE-8, the event object seems to become somehow invalidated after it's captured in the closure. Question: Why is this happening in IE-8, and is there any workaround?

    Read the article

  • JavaScript addEvent function

    - by Yalmaz Khalil
    I have an addEvent function: function addEvent(elem, event, func ) { if (typeof (window.event) != 'undefined') elem.attachEvent('on' + event, func); else elem.addEventListener(event, func, false); } <a href="#" id="link">link</a> and I'm trying to add the following to window.onload: addEvent(window, 'load', function (){ // add another event var link= document.getElementById('link'); addEvent(link, 'click', function () {alert('Hi'); }); }); My question is: why does the link event not work?

    Read the article

  • How to push oath token to LocalStorage or LocalSession and listen to the Storage Event? (SoundCloud Php/JS bug workaround)

    - by afxjzs
    This references this issue: Javascript SDK connect() function not working in chrome I asked for more information on how to resolve with localstorage and was asked to create a new topic. The answer was "A workaround is instead of using window.opener, push the oauth token into LocalStorage or SessionStorage and have the opener window listen to the Storage event." but i have no idea how to do that. It seems really simple, but i don't know where to start. I couldn't find an relevant examples. thanks for your help!

    Read the article

  • Open Select using Javascript/jQuery?

    - by Newbie
    Hello! Is there a way to open a select box using Javascript (and jQuery)? <select style="width:150px;"> <option value="1">1</option> <option value="2">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc arcu nunc, rhoncus ac dignissim at, rhoncus ac tellus.</option> <option value="3">3</option> </select> I have to open my select, cause of ie bug. All versions of IE (6,7,8) cut my options. As far as I know, there is no css bugfix for this. At the moment I try to do the following: var original_width = 0; var selected_val = false; if (jQuery.browser.msie) { $('select').click(function(){ if (selected_val == false){ if(original_width == 0) original_width = $(this).width(); $(this).css({ 'position' : 'absolute', 'width' : 'auto' }); }else{ $(this).css({ 'position' : 'relative', 'width' : original_width }); selected_val = false; } }); $('select').blur(function(){ $(this).css({ 'position' : 'relative', 'width' : original_width }); }); $('select').blur(function(){ $(this).css({ 'position' : 'relative', 'width' : original_width }); }); $('select').change(function(){ $(this).css({ 'position' : 'relative', 'width' : original_width }); }); $('select option').click(function(){ $(this).css({ 'position' : 'relative', 'width' : original_width }); selected_val = true; }); } But clicking on my select the first time will change the width of the select but I have to click again to open it.

    Read the article

  • jQuery li:has(ul) selector issue

    - by sushil bharwani
    I was creating a tree using UL LI list and jQuery. I used a jQuery Selector jQuery(li:has(ul)) to find all the list nodes having childs and then added a click event to it. jQuery(li:has(ul)).click(function(event) { jQuery(this).children.toggle(); jQuery(this).css("cursor","hand"); }); This works for me except i dont understand why i get a cursor hand and click event triggering even when i take mouse pointer to childs of my selected li <li> Parent // it works here that is fine <ul> <li> child1 // it works here i dont understand need explanation </li> <li> child2 // it works here i dont understand need explanation </li> </ul> </li>

    Read the article

  • Child control view model event

    - by Jmsparing
    Hi, I seem to have got stuck in a situation where I have a parent and child usercontrol. I want to be able to raise an event in the child and have the parent handle this event. How do I trigger the event in my child view model and handle it in the parent view model. If anybody has a simple example that would be really good. Thanks very much.

    Read the article

  • Using numeric values to select item from a dropdown box with JavaScript

    - by Shyam
    Hi, I have a multitude of dropdown boxes within my webpage. One of these dropdown boxes is used for a single selected value out of a list of options. <SELECT id="Box0" name=""> <OPTION value="0">none</OPTION> <OPTION value="1">first</OPTION> <OPTION value="2">second</OPTION> </SELECT> How can I add an event to this section, so when it is in focus, I could use numeric keys like 1,2.. to select an option instead of using the mouse or arrow keys for selecting an option? For clarification: if I press "1" on my keyboard, the selected value would become "first", with "2" the selected value becomes "second". I choose not to use a library/framework such as JQuery/Mootools. Thanks,

    Read the article

  • Drag and drop an image from desktop to a web text editor (implementation in javascript)

    - by fatmatto
    I tried to write reasonably short title but i failed i guess.. Hi everybody here's what i'm trying to do: I want to implement a web text editor able to recognize when the user drag a image file over it's editing surface and it automa(gically) starts the upload and insert the image near the cursor position. In other words i don't want the user to do the usual "insert-image-browse-ok". Atm i am not very good at javascript ... i know JQuery but i have not a clear idea about how to implement this... i don't know if there's an event handler able to help me in this situation... if not then there should be i think or web apps would miss some kind of interactivity. I've heard miracles about HTML5 could it help me? I've seen such things in Google Wave but that surface doesn't seem to be a form field... google lab's black magic i guess.... Thank you in advance.

    Read the article

  • JavaScript: How can I delay running some JS code until my JS file downloaded?

    - by Henryh
    I have the following code: <script type="text/javascript"> function addScript(url) { var script = document.createElement('script'); script.src = url; document.getElementsByTagName('head')[0].appendChild(script); } addScript('http://example.com/One.js'); addScript('http://example.com/Two.js'); addScript('http://example.com/Three.js'); addScript('http://example.com/Four.js'); ... // run code below this point once Two.js has been downloaded and excuted </script> How can I detect when one of my JavaScript files has been downloaded and executed so that I can use it?

    Read the article

  • Google Visualization API Geomap: How to handle marker click events?

    - by Carlos da Costa
    Hello. I initially have the Google Visualization API Geomap on a world view (options['dataMode'] = 'regions') and I capture the 'regionClick' event when a country is clicked like so: google.visualization.events.addListener( geomap, 'regionClick', function (e) { var rowindex = data.getFilteredRows([{column: 0, value: e['region']}]); var location = data.getValue(rowindex[0], 3); location.href = "?ISO=" + e['region'] + "&Location=" + location; }); I then draw the map zoomed into the country in markers mode (options['dataMode'] = 'markers'). However, I can't seem to capture any events when the markers themselves are clicked. The documentation ( http://code.google.com/apis/visualization/documentation/gallery/geomap.html#Events ) only refers to 'select' and 'regionClick' events neither of which are fired in this case. (Tested using Chrome 9, and IE 8.) Has anybody had any success in doing this? Many thanks.

    Read the article

  • how to code client-side call to webservice that calls automatically every few seconds

    - by Bob Jones
    I have a webservice that I want to call from the browser every few seconds to see if there are any notification messages in the database that should be displayed on the screen. We have the JSON code working to display the messages in a JavaScript function after an Async Postback, but this only executes after a page turn. I want it to execute every 10-15 seconds as well. A code sample would be very helpful.

    Read the article

  • 12c und keine Ahnung? - Experten stehen Rede und Antwort auf Oracle-12c-Launch-Events

    - by Anne Manke
    Jetzt ist sie raus - die neue Oracle Datenbankversion 12c ist veröffentlicht. Auf unseren Oracle-12c-Launch-Events im Juli und August können Sie sich mit dieser neuen und innovativen Datenbankversion vertraut machen, und alles über die neuesten Funktionen und Features erfahren.  Referenten und Datenbankexperten stehen Ihnen Rede und Antwort zum Thema Oracle 12c. Melden Sie sich gleich hier für die kostenlosen Workshops an!  Datum  Stadt Anmeldung & Agenda 18. Juli 2013 Köln Event in Köln - hier anmelden! 13. August 2013 Hamburg Event in Hamburg - hier anmelden!

    Read the article

  • Preview an html page without opening it

    - by Hulk
    On click a image how can another page be previewed in the same page without opening the actual page.And lets say the url /home/home.php?id=3 The preview should be in the preview div <img src="/home/app/img/toggle.gif" onlclick="show();" /> <div id="preview"></div> Thanks..

    Read the article

  • Suppressing .net's updatepanel submit event handler

    - by wheresrhys
    I'm performing some custom js validation on my forms, triggered by submitting the form $("form").submit(function (e) { var validates = true; // validation code goes in here if (!validates) { e.preventDefault(); e.stopImmediatePropagation(); return false; } }) None of the lines I've included to stop the submit event prevent the .NET control posting back. Is there some way (using js or setting a property in the updatepanel control) of stopping post back?

    Read the article

  • Problem executing trackPageview with Google Analytics.

    - by dmrnj
    I'm trying to capture the clicks of certain download links and track them in Google Analytics. Here's my code var links = document.getElementsByTagName("a"); for (var i = 0; i < links.length; i++) { linkpath = links[i].pathname; if( linkpath.match(/\.(pdf|xls|ppt|doc|zip|txt)$/) || links[i].href.indexOf("mode=pdf") >=0 ){ //this matches our search addClickTracker(links[i]); } } function addClickTracker(obj){ if (obj.addEventListener) { obj.addEventListener('click', track , true); } else if (obj.attachEvent) { obj.attachEvent("on" + 'click', track); } } function track(e){ linkhref = (e.srcElement) ? e.srcElement.pathname : this.pathname; pageTracker._trackPageview(linkhref); } Everything up until the pageTracker._trackPageview() call works. In my debugging linkhref is being passed fine as a string. No abnormal characters, nothing. The issue is that, watching my http requests, Google never makes a second call to the tracking gif (as it does if you call this function in an "onclick" property). Calling the tracker from my JS console also works as expected. It's only in my listener. Could it be that my listener is not deferring the default action (loading the new page) before it has a chance to contact Google's servers? I've seen other tracking scripts that do a similar thing without any deferral.

    Read the article

  • Is there a way to get photo tags and new friendship type events by querying the FQL stream table?

    - by Fletcher Moore
    When you look at your stream on the Facebook website, events such as "FriendX was tagged in an album", "FriendY is attending EventZ", and "FriendK and FriendL are now friends". I've tried various "vague" queries on the stream table, and so far I have been unable to get these types of events. Is this possible, or do I need to query the all of the other tables and write a ton of logic to try to figure out which new events to show and how to show them?

    Read the article

  • Using JQuery to get text of a div that's a child of a header to replace a different header

    - by Stevie Jenowski
    Hello all, I'm trying to get the text contents of a .div('.child#') child of my event.target('h6.class'), and replace my other headers('h1.replacHeader#') using this script below... $('h6.class').click(function(event) { var $target = $(event.target); $('.replaceHeader1').replaceWith("<h1 class='replaceHeader1'>" + $target.children(".child1").text() + "</h1>"); $('.replaceHeader2').replaceWith("<h1 class='replaceHeader2'>" + $target.children(".child2").text() + "</h1>"); }); }); I've noticed that .text() apparently doesn't apply to an event.target... So how could I go about achieving this?

    Read the article

  • Javascript tr click event with newly created rows

    - by yalechen
    I am very new to web development. I am currently using tablesorter jquery plugin to create a dynamic table, where the user can add and delete rows. I am having trouble with changing the background color of newly created rows upon clicking. It works fine with rows that are hard coded in html. Here is the relevant code: $(document).ready( function() { $('table.tablesorter td').click( function (event) { $(this).parent('tr').toggleClass('rowclick'); $(this).parent('tr').siblings().removeClass('rowclick'); }); } ) rowclick is a css class here: table.tablesorter tbody tr.rowclick td { background-color: #8dbdd8; } I have tried adding the following to my javascript function that adds a new row: var createClickHandler = function(newrow) { return function(event) { //alert(newrow.cells[0].childNodes[0].data); newrow.toggleClass('rowclick'); newrow.siblings().removeClass('rowclick'); }; } row.onclick = createClickHandler(row); The alert correctly displays the text in the first column of the row when I click the new row. However, my new rows do not respond to the css class. Anyone have any ideas? Thanks in advance.

    Read the article

  • Filter the datagridview column based on the current row of another column in C#

    - by user286546
    I have a datagridview that is populating columns from different table. I want to filter the column based on another column of the current row. I tried to use the cell enter event of the datagridview and then filtered the column by filtering the binding source on the column of the current row. private void lINKDataGridView_CellEnter(object sender, DataGridViewCellEventArgs e) { this.pROBLEMBindingSource.Filter = "item_id = " + this.lINKDataGridView.Rows[e.RowIndex].Cells[dataGridViewTextBoxColumn4.Index].Value + ""; } This is how I am filtering the "problem " binding source on the cell enter event of the datagridview . It is working fine but I am getting an error- being: System.ArgumentException: DataGridViewComboBoxCell value is not valid. Any suggestion

    Read the article

< Previous Page | 97 98 99 100 101 102 103 104 105 106 107 108  | Next Page >