Search Results

Search found 28881 results on 1156 pages for 'javascript is future'.

Page 68/1156 | < Previous Page | 64 65 66 67 68 69 70 71 72 73 74 75  | Next Page >

  • Possible to bind an event listener to a (hypothetical) onChangeInnerHTML event?

    - by DustMason
    In my app, I have an OL tag whose contents are changed by various other dynamic events. Is there some way to put a listener on that OL so that I can execute a function whenever its contents are altered in any way? In this example I need to update a count of items in the list which appears in another spot in the interface. I am using jQuery if that helps. The contents of the OL are being changed with OL.append() and LI.remove(), in case those methods have some special events that I don't know about Thanks!

    Read the article

  • Javascript form validation events

    - by user307922
    Hi All, I am making a small form for a php app and had a question regarding javascript validation. What is the best event to run the javascript validation on the input value? Is it the "focusout" event? I used "focusout" to originally but it creates problems when the user hits enter while they are still focused on any particular field in the form. Should I run the js validation when the user clicks submit? Just looking for some advice. Thanks! Chuck

    Read the article

  • MooTools Problem in IE with Request

    - by trobrock
    I have this class method in a mootools class: getData : function(){ var r = new Request.JSON({ url : this.container.getAttribute('data-url'), method : 'post', onSuccess : function(j){ this.cards = j; this.prepareQuiz(); }.bind(this) }).send(); }, In any browser aside from IE this works fine, but in IE I get a this.cards is not defined in a method that occurs after the this.prepareQuiz method does it's stuff. I narrowed the problem to this section by adding an if ($defined(this.cards)) before the this.prepareQuiz call and if I just keep refreshing the page 1 out of every 5 or so times it will work. So the this.cards variable is not being set some of the time for some reason. Why would this happen?

    Read the article

  • Determine if javascript has completed.

    - by Duracell
    My question is somewhat similar to this one. We want to know if there's a way to determine if all javascript has completed (so no javascript is running). We have a lot of stuff that runs on a timeout after the page's onload event, so even after the page is loading, stuff could be happening for a few seconds. For a whole bunch of reasons, mostly relating to requirements from management, we need to know when all of these scripts have finished running. There's an arbitrary number of them so a general solution would be great.

    Read the article

  • jQTouch on Iphone - jumping to specific DIV after onclick and javascript function

    - by Guus
    I am just starting to use jQTouch. In #contact I have a button that calls javascript function sendEmail() How can I jump to/show the div #statusDiv in the javascript function after sending the email? function sendEmail() { // sending email // --> how to jump to DIV called statusDiv } <div id="home" class="current"> </div> <div id="contact" > <ul class="rounded"> <li ><a id="emailButton" onclick="sendEmail()">Stuur email</a></li> </ul> </div> <div id="statusDiv"> </div>

    Read the article

  • Setting background-image with javascript

    - by Mattoe3k
    In chrome, safari, and opera setting the background image to an absolute reference such as: "/images/image.png" changes it to "http://sitepath/images/image.png". It does not do this in firefox. Is there any way to avoid this behavior, or is it written into the browser's javascript engine? Using jquery to set the background-image also does this problem. The problem is that I am posting the HTML to a php script that needs the urls in this specific format. I know that setting the image path relative fixes this, but I can't do that. The only other alternative would be to use a regexp. to convert the urls. Thanks. Test this in firefox, and chrome / webkit browser: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <div style="height:400px;width:400px;background-image:url(/images/images/logo.gif);"> </div> <br /> <br /> <div id="test" style="height:400px;width:400px;"> </div> <script type="text/javascript" src="/javascripts/jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#test").css('background-image',"url(/images/images/logo.gif)"); alert(document.getElementById('test').style.backgroundImage); }); </script> </body> </html>

    Read the article

  • What's wrong with addlistener... how do i fire my event

    - by KoolKabin
    I am using the following functions to do my task. It works fine when cursor moves away from textbox but if i want to fire the same event from code say like next function i get error... function addEvent( obj, type, fn ) { if (obj.addEventListener) { obj.addEventListener( type, fn, false ); } else if (obj.attachEvent) { obj["e"+type+fn] = fn; obj[type+fn] = function() { obj"e"+type+fn; } obj.attachEvent( "on"+type, obj[type+fn] ); } else { obj["on"+type] = obj["e"+type+fn]; } } function addEventByName(ObjName, event, func){ MyEle = document.getElementsByName(ObjName); addEvent(MyEle[0], event, func); } addEventByName("txtBox", 'blur', function(){ alert('hello'); }); function fire(){ x = document.getElementsByName('txtBox')[0]; x.blur(); //gives error x.onblur(); //gives error }

    Read the article

  • Parsing plain data with Javascript (JQuery)

    - by Angelus
    Well , I have this text in a Javascript Var: GIMP Palette Name: Named Colors Columns: 16 # 255 250 250 snow (255 250 250) 248 248 255 ghost white (248 248 255) 245 245 245 white smoke (245 245 245) 220 220 220 gainsboro (220 220 220) 255 250 240 floral white (255 250 240) 253 245 230 old lace (253 245 230) 250 240 230 linen (250 240 230) 250 235 215 antique white (250 235 215) 255 239 213 papaya whip (255 239 213) And What I need is to cut it in lines and put them in one Array , after that i must separate each number and the rest in an string. I'm getting crazy searching functions to do that but now i can't see anyone in Javascript. modified End expected format will be first the next: array[0]='255 250 250 snow (255 250 250)' Then i wanna take it and extract each line into some vars to use them: colour[0]=255; colour[1]=250; colour[2]=250; string=snow (255 250 250); (the vars will be reused with each line)

    Read the article

  • Simple Hide/Expand with Javascript

    - by user478419
    I have created a simple expand/hide test script: <html> <head> <script type="type/javascript"><!-- function showHide(elementid){ if (document.getElementById(elementid).style.display == 'none'){ document.getElementById(elementid).style.display = ''; } else { document.getElementById(elementid).style.display = 'none'; } } //--> </script> </head> <body> <div><a href="javascript:showHide('div_1035677');">more...</a></div> <div id="div_1035677" style="display:none"> HIDDEN CONTENT </div> </body> </html> I get an error message that I can't make any sense of (Object expected on line one). I don't see any errors in the above code. :-(

    Read the article

  • split with javascript

    - by Sourabh
    Hi below is something I am trying to do with JavaScript. If I have string like str = "how are you? hope you are doing good" ; now I want to split it with ? but I dont want to lose the "?". Instead I want to break the string just after the question mark such a way that question mark is with the first segment that we have after splitting str what should I get is ["how are you?","hope you are doing good"] I am not sure if it can be done with Javascript split() function ,please help.

    Read the article

  • Chrome Javascript

    - by Mike
    i have two spans on my page with class='hidden' and then some javascript to remove the class when a condition is met, its working fine in ie 9/10 and firefox but its not working in chrome when I run the function in the chrome JS console I get the message TypeError: Cannot read property 'attributes' of null Anybody know whats going on? <script type='text/javascript' > function showhidden() { var att =document.getElementById('hiddentextbox'); att.attributes[0].value=''; att =document.getElementById('hiddentextbox1'); att.attributes[0].value=''; }</script> Thanks

    Read the article

  • Supersized image captions - render outside of JavaScript

    - by Sol
    I am using the jQuery supersized script for a full screen slideshow (not the WordPress plugin as this didn't give me enough control). However, one issue that I am trying to tackle is how to render the image caption text outside of the javascript slides[ ] call - and instead, render them within the page div - to improve SEO on the page. My code works fine right now, images and the caption text are correctly displaying, but looking at the source code, there is very little text outside of the javascript (which is bad for SEO), so I would just like to improve it, if possible. I haven't been able to find any other topic on this subject and so far, I've been unsuccessful at improving on the current code, which is as follows; <!-- Supersized 3.2.7 - By Sam Dunn / One Mighty Roar (www.onemightyroar.com) Released under MIT License / GPL License --> <script type="text/javascript"> var slides=[]; <?php $my_query = new WP_Query ( array( 'post_status' => 'publish', 'post_type' => 'featured', //'numberposts' => 5, 'orderby' => 'menu_order', 'order' => 'ASC', 'showposts' => 50 )); while( $my_query->have_posts() ) : $my_query->the_post(); $slink = get_post_meta($post->ID,'FS_link',true); ?> slides.push({image : '<?php echo get_image_path(get_post_meta($post->ID, 'FS_slideimage_src', true)); ?>', title : '<div class="slidecaptioninside"><h1><?php echo the_title(); ?></h1><p><?php echo strip_tags(get_post_meta($post->ID, 'FS_fitemcaption', true)); ?>...<a href="<?php echo $slink;?>">find out more</a></p></div>', url : '<?php echo $slink;?>'}); <?php endwhile; ?> // start supersized JS $j = jQuery.noConflict(); $j(window).load(function() { $j.supersized({ //Functionality slideshow: 1, // ..... additional functions go here... slide_captions : 1, //Slide caption (Pull from "title" in slides array) slides : slides, slide_links : 'blank', progress_bar : 1, mouse_scrub: 1 }); }); </script> <div id="slidecontainer"> <div id="slidecaption"></div> <!--Thumbnail Navigation--> <div id="prevthumb"></div> <div id="nextthumb"></div> <!--additional tray divs here--> </div><!--slidecontainer--> I have tried to get Supersized to output the content into a parent div [div id="supersized"] using $j('#supersized').supersized({ but this doesn't appear to work. Has anyone managed to do this differently to improve page SEO?

    Read the article

  • How do i translate this to "simpler" JavaScript?

    - by Julian Weimer
    Since i'm working with Titanium i realzed that its current JavaScript Interpreter doesn't accept specific coding-styles. So for for-loops and if-statements i have to have braces, even though i only want to span one line. Furthermore there is more i have to change if i want to use a Javascript Library like underscore.js. This is what Titanium doesn't want to see: if (!(result = result && iterator.call(context, value, index, list))) {_.breakLoop();} if (nativeSome && obj.some === nativeSome) {return obj.some(iterator, context);} var computed = iterator ? iterator.call(context, value, index, list) : value; computed >= result.computed && (result = {value : value, computed : computed}); Can i use a simpler syntax to describe the logic behind those lines of code?

    Read the article

  • Can I pass a string variable into an <a href> tag for a website link?

    - by Joseph
    I am somewhat new to web developing, so I am trying to learn along the way. I have a div that is 500 x 500. Inside of that div I have two divs that are each 250x500. So my outer div is filled up with the two inner divs. I have it setup so that when I click on the first div (the left one) a java script is called, and a prompt pop up box asks for a website URL which is then stored inside of a string variable. How can I make it so that the second div (the right one) takes the string variable from the alert box from the left div and puts it into an a href tag so that I can link to the website from the right div? Can a a href tag accept a value from a variable for its link? Maybe I am going about this all wrong, is there a better way I should be approaching this? Any help is appreciated!!

    Read the article

  • Ensuring Updated CSS/JavaScript on Client Side

    - by Alex
    I'm trying to ensure that visitors of my ASP.NET MVC website always have the most-current CSS and Javascript (and not some older cached version). I tried to realize this by generating a seed value when the application domain starts, and automatically append it to the CSS and Javascript URLs (so now instead of /Content/All.js the link is /Content/All.js?549238 etc.). Unfortunately I just found out by debugging via Firebug that this causes now a full download request every time (the new "seeded" response is no longer cached at all, but I only wanted the first check to download the 'updated' version, but then cache again/only check if there is a difference). How can I achieve my goal, is there a better way of doing this? I need the client to always request the newest version, but then cache if no change happened. Edit: This appears to be related to the fact that my page is served over SSL. I asked a follow up question here regarding enabling clientside caching with SSL.

    Read the article

  • javascript button click casuing Internet Explorer secuirty exception...

    - by hp
    Hello, I have a application that allows a user to choose some parameters for a powerpoint report, run the report, then allow the user to "save" or "open" the powerpoint file. I got all of that working OK. When you click on "run" report, it pops open a window which generates the report, stores it in session, then closes the window. I have a button on the main page that will export the report. So, now, when the pop up window that generates the report is finished, i use "window.opener" to call a javascript method on the main page, that will do a javascript click of the button. when this button is pressed, Internet Explorer gives me the following message : "To help protect your security, Internet Explorer blocked this site from downloading files to your computer.." Do you guys know of any tricks around this?

    Read the article

  • Binded click loses context of my Class. JS

    - by Fabiano PS
    Hi, I have this problem that I probably understand but don't know how to handle, if there is a way. I have a class simplified as this: function DrawingTable(canvas_id){ this.canvas_id = canvas_id; bind_events() function bind_events(){ $(get_canvas()).click(function(e){ var canvas = get_canvas() //works do_something_in_the_instance_who_called_click() } function get_canvas(){return document.getElementById(canvas_id)} function do_something_in_the_instance_who_called_click(){ alert(this.canvas_id) //fail! } } Because when the click() is invoked for what it looks this is not inside the instance anymore, but I need to change atributes from there.. is there a way, given that may be multiple instances? I don't really know how but the get_canvas() works :) I'm using jQuery but likely not relevant

    Read the article

  • Visual Studio 2008 Unresponsive When Opening JavaScript Files

    - by lush
    I'm starting a new ASP.NET project that I'm trying to use some jQuery with, but whenever I try to open .js file (blank or containing a few lines of javascript) in Visual Studio, it often hangs; showing the .js filename in a new tab, but the actual text editor window showing whatever was drawn to the screen before opening the .js file. Eventually, after closing and re-opening, it will open in the text editor, but the font is always something like 10pt Arial. Even after changing this in VS options, the next re-launch of Visual Studio yields the same results. Has anyone else experienced hang, unresponsiveness, wonkiness from Visual Studio with JavaScript files?

    Read the article

  • Using array of asp inside javascript is not working in the loop

    - by Poomjai
    I have a problem that when i bring the array of asp and use it in the javascript, When i use the counter (i++) and print for each index of array just like "<%=app[i] %" and it is not return the value back to me. Please help me i solve this problem for a day !!!-Thanks ^_^ edit <% String[] asp = {"a","b","c"}; %> <script language="javascript"> for(var i=0;i<"<%=asp %>".length;i++){ document.write("<%=asp[i] %>") } </script> the error is = Compiler Error Message: CS0103: The name 'i' does not exist in the current context

    Read the article

  • Using Selenium-IDE with a rich Javascript application?

    - by Darien
    Problem At my workplace, we're trying to find the best way to create automated-tests for an almost wholly javascript-driven intranet application. Right now we're stuck trying to find a good tradeoff between: Application code in reusable and nest-able GUI components. Tests which are easily created by the testing team Tests which can be recorded once and then automated Tests which do not break after small cosmetic changes to the site XPath expressions (or other possible expressions, like jQuery selectors) naively generated from Selenium-IDE are often non-repeatable and very fragile. Conversely, having the JS code generate special unique ID values for every important DOM-element on the page... well, that is its own headache, complicated by re-usable GUI components and IDs needing to be consistent when the test is re-run. What successes have other people had with this kind of thing? How do you do automated application-level testing of a rich JS interface? Limitations We are using JavascriptMVC 2.0, hopefully 3.0 soon so that we can upgrade to jQuery 1.4.x. The test-making folks are mostly trained to use Selenium IDE to directly record things. The test leads would prefer a page-unique HTML ID on each clickable element on the page... Training the testers to write or alter special expressions (such as telling them which HTML class-names are important branching points) is a no-go. We try to make re-usable javascript components, but this means very few GUI components can treat themselves (or what they contain) as unique. Some of our components already use HTML ID values in their operation. I'd like to avoid doing this anyway, but it complicates the idea of ID-based testing. It may be possible to add custom facilities (like a locator-builder or new locator method) to the Selenium-IDE installation testers use. Almost everything that goes on occurs within a single "page load" from a conventional browser perspective, even when items are saved Current thoughts I'm considering a system where a custom locator-builder (javascript code) for Selenium-IDE will talk with our application code as the tester is recording. In this way, our application becomes partially responsible for generating a mostly-flexible expression (XPath or jQuery) for any given DOM element. While this can avoid requiring more training for testers, I worry it may be over-thinking things.

    Read the article

  • Get array of elements from event

    - by Anton
    I have few nested DIV elements. For example: <div id='id1'><div id='id2'>content</div></div> I attach event to DIVs event handler using jQuery: $('div').click(function () { //some code }); There will be two events when user click on content. So there will be two simultaneous events. Is it possible to get inside event handler array of objects (DIVs) what have click event? May be it is possible using other framework but jQuery?

    Read the article

< Previous Page | 64 65 66 67 68 69 70 71 72 73 74 75  | Next Page >