Search Results

Search found 30511 results on 1221 pages for 'javascript events'.

Page 7/1221 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Need Help With This Simple Script (JavaScript Noob Question)

    - by three3
    Hi everyone, I am new to JavaScript (only a couple of days of reading a book) and I am stuck on this code snippet. I have looked at it over and over again but cannot seem to figure out why it is not working. I am sure it is something really simple that I have just looked over but I really just need a fresh pair of eyes to look at this. The code is supposed to update a placeholder image on a page without the page having to reload. But when I am clicking on the link of an image, it is taking me to the link where the image is located instead of replacing the placeholder image. Here is my HTML code: <!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>Image Gallery</title> <script type="text/javascript" src="scripts/showPic.js"></script> </head> <body> <h1>Snapshots</h1> <ul> <li> <a href="images/cat.jpg" onclick="showPic(this); return false;" title="A Cat">Cat</a> </li> <li> <a href="images/night.jpg" onclick="showPic(this); return false;" title="Night">Night</a> </li> <li> <a href="images/coke.jpg" onclick="showPic(this); return false;" title="Coke">Coke</a> </li> <li> <a href="images/sport.jpg" onclick="showPic(this); return false;" title="Sports">Sport</a> </li> <li> <a href="images/mnms.png" onclick="showPic(this); return false;" title="MnM's">MnM's</a> </li> <li> <a href="images/kid.jpg" onclick="showPic(this); return false;" title="A Kid">Kid</a> </li> </ul> <br /> <img src="images/placeholder.jpg" title="Place Holder Image"> </body> </html> And here is the JavaScript function I am using to get this done: <script type="text/javascript"> function showPic(whichpic) { var source = whichpic.getAttribute("href"); var placeholder = document.getElementById("placeholder"); placeholder.setAttribute("src",source); } </script> Any help is greatly appreciated and thanks in advance for the help.

    Read the article

  • WebCenter Marketing and Upcoming Events

    - by rituchhibber
    Events: Events: Date Event Name Location/Country October 30, 2012 ResCare Solves Content Lifecycle Challenges with Oracle WebCenter Webcast November 1, 2012 Paper Burying Your HR Processes? Dig Your Way Out With Oracle WebCenter! Webcast November 15, 2012 Social Business Thought Leader Webcast: Three Ways to Fix Your Broken Organization, featuring Christian Finn Webcast Marketing: Marketing: WebCenter Sites Sales eVite:Embrace the Base: Create an Exceptional Online Customer Experience with Oracle WebCenter Sites Directs recipients to the Connected Customer Experience Resource Center to see the latest demos, analyst reports, and customer webcasts promoting WebCenter Sites. For more information Click  here. WebCenter Social Business Thought Leaders Series: Digital Darwinism: How Brands Can Survive the Rapid Evolution of Society and TechnologyBrian Solis, Altimeter Group digital analyst and futuristDecember 13, 2012 10am PDTRegistration available soon, find other content from this speaker here. Webcast: WebCenter Sites for Applications: Disconnected Online Customer Experience? Connect it with Oracle WebCenter November 8, 2012  eVite | Registration Page WebCenter in Action Customer & Partner webcast series: Started earlier in FY13, a new webcast series featuring WebCenter customer deployments that are executed by a partner.The next webcast in the series will be November 14th:Los Angeles Department of Building & Safety Lowers Customer Service Costs with Oracle WebCenter Click here to learn more. OnDemand Webcast: ResCare Solves Content Lifecycle Challenges with Oracle WebCenterComplex documents must be created, assembled, reviewed, and tracked. To avoid fragmented, chaotic information processes, organizations must adopt an integrated set of strategies, standards, best practices, and technologies for managing information. Attend this webcast to learn how Oracle WebCenter has allowed ResCare to: solve content lifecycle challenges, reduce compliance and business risks and increase adoption of intranet as primary business communication tool. On-Demand Assets Date Event Name Location/Country On Demand Avoid Social Media Fatigue - Learn the 9 C’s of Customer Engagement, featuring Ray Wang, Principal Analyst and CEO, Constellation Research Webcast On Demand WebCenter in Action Series: Hitachi Data Systems Improves Global Web Experience with Oracle WebCenter, presented by Hitachi Data Systems and Lingotek. Webcast On Demand Managing Social Relationships for the Enterprise, featuring Jeremiah Owyang, Industry Analyst, Altimeter Group and Reggie Bradford, Vice President, Oracle Webcast On Demand Oracle’s Vision for the Social-Enabled Enterprise, presented by Mark Hurd, Thomas Kurian and Reggie Bradford Webcast On Demand WebCenter in Action Series: Qualcomm Provides a Seamless Experience for Customers with Oracle WebCenter, presented by Qualcomm and Keste. Webcast On Demand Social Business Thought Leaders Series: 6 Counterintuitive Best Practices for Social Collaboration Adoption, featuring John Brunswick, Oracle. Webcast On Demand Oracle WebCenter Connects Patients and Researchers in Cancer Control Mission, presented by Canadian Partnership Against Cancer and App-Systems Webcast On Demand Oracle WebCenter: Modernize, Aggregate and Extend Your Portals Webcast On Demand Top 10 Technology Trends Driving Business Innovation, featuring Andy Mulholland, CTO, Capgemini Webcast On Demand Ancestry.com Helps Families Uncover History with Oracl e WebCenter Webcast On Demand Organic Business Networks: Doing Business in a Hyper-Connected World, featuring Mike Fauscette, GVP, IDC Webcast On Demand Social Business and Innovation, featuring John Mancini, President, AIIM Webcast On Demand Do More with Oracle WebCenter: Expand Beyond Web Experience Management Webcast On Demand Race Against the Machine, featuring Andrew McAfee, author and principal scientist at MIT Webcast On Demand Introducing Oracle WebCenter Sites 11gR1: Transforming the Online Experience Webcast On Demand Mobile is the New Face of Engagement, featuring Ted Schadler, Vice President & Principal Analyst, Forrester Research Inc Webcast Analyst Report: IDC Research: Oracle Debuts New Release of Oracle WebCenter Sites.

    Read the article

  • Best server-side javascript servers.

    - by fmsf
    Hey, I've been wondering to try out server-side javascript for a while. And I'm finding a good amount of servers, like: Node.js Rhino SpiderMonkey among others. Could anyone with experience on server-side javascript, tell me which are the best engines? and why? I like the Node.js because it's based on Google's V8 engine. And seems easy to use. But some feedback on what you would choose would be great. Edit: Some benchmarks for Node. I'm thinking on going with this one but feedback is still welcome. Thanks

    Read the article

  • javascript error "invalid XML attribute value <script language=JavaScript>\n"

    - by kmunky
    i have some javascript files included in my html file for months. It used to work just fine until couple of days ago, now my scripts don't run anymore and i get javascript error "invalid XML attribute value <script language=JavaScript>\n" with firebug. Does anyone know what this error means and how to get rid of it? i guess is something about that newline "\n" but i can't see that in my file if i open it.

    Read the article

  • Ruby on Rails Mysterious Javascript Alert box with cookie information

    - by conorgil
    I have a problem in a Ruby on Rails app that I am working on. I have been working on the app for months and I have never had this problem before and after a bit of Google searches I think that somehow someone is trying to steal cookies with javascript. When I click on the link I get an alert box titled "the page at www.napkinboard.com says:" and contains the following message: __utmz=217223433.1270652009.59.3.utmcsr=localhost:3000|utmccn=(referral)|utmcmd=referral|utmcct=/; __utma=217223433.2133018314.1265749085.1271097412.1271125626.63; __utmc=217223433; __utmb=217223433.11.10.1271125626 I checked the database and all data associated with this 'food_item' looks completely normal and does not contain any javascript at all. How did this suddenly happen and how can I stop it? I appreciate any help. Thanks.

    Read the article

  • What is the `name` keyword in JavaScript?

    - by Joey Adams
    When I typed this apparently innocent snippet of code: values.name gedit highlighted name as a keyword. However, name is not listed by the pages linked to by an answer to a question about reserved keywords. I also did a couple trivial tests in SpiderMonkey, but name seemed to act like an ordinary identifier. A Google search didn't tell me much either. However, I did find a page listing name in "Other JavaScript Keywords". My guess is that name is a function or a member of some DOM element and does not intrude on the namespace. Is name really a keyword in JavaScript? If so, what does it do?

    Read the article

  • Hiding privates from Javascript Intellisense

    - by Robert Koritnik
    Is it possible to hide certain functions/fields from displaying in javascript intellisense drop down list in Visual Studio 2008? Either by javascript documentaion XML of by naming privates in a certain way? I've seen <private /> in jquery vsdoc file that implies exactly this behaviour, but doesn't meet my expectations { __hiddenField: 0, /// <private /> increment: function(){ /// <summary>Increments a private variable</summary> __hiddenField++; } } But since fields can't contain documentation (because they have no body) they have to be documented at the top. But still doesn't work: { /// <field name="__hiddenField" type="Number" private="true">PRIVATE USE</field> __hiddenField: 0, increment: function(){ /// <summary>Increments a private variable</summary> __hiddenField++; } } Impossible is a perfectly possible answer and will be accepted if you have the knowledge that it's actually not possible.

    Read the article

  • Firefox drags div like it was an image, javascript event handlers possibly to blame

    - by user281434
    Hi, I'm using this HTML,CSS and Javascript code (in one document together if you want to test it out): <style type="text/css"> #slider_container { width: 200px; height: 30px; background-color: red; display:block; } #slider { width: 20px; height: 30px; background-color: blue; display:block; position:absolute; left:0; } </style> <script type="text/javascript" src="../../js/libs/jquery-1.4.2.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $("#slider").mousedown(function() { $(document).mousemove(function(evnt) { $("#test").html("sliding"); }).mouseup(function() { $("#test").html("not sliding"); $(document).unbind("mousemove mouseup"); });}); }); </script> <div id="test">a</div> <div id="slider_container"> <div id="slider"></div> </div> Everything (surprisingly) works fine in IE, but firefox seems to totally clusterf*ck when this javascript is used. The first "slide" is okay, you drag, it says "sliding", you drop, it says "not sliding". On the second "slide" (or mousedown if you will), firefox suddenly thinks the div is an image or link and wants to drag it around. Screenshot of the dragging: http://i.imgur.com/nPJxZ.jpg Obviously the blue div half-positioned in the red div is the one being dragged. Windows does not capture the cursor when you take a screenshot, but it's a stop sign. Is there someway to prevent this default behaviour?

    Read the article

  • Javascript timers

    - by resopollution
    I'm starting on a javascript MMORPG that will actually work smoothly. Currently, I created a demo to prove that I can move characters around and have them chat with each other, as well as see eachother move around live. http://set.rentfox.net/ Now Javascript timers are something I have not used extensively, but from what I know, correct me if I'm wrong, is that having multiple setIntervals happening at the same time doesn't really work well b/c it's all on a single thread. Lets say I wanted to have 10 different people nuking fireballs at a monster by using sprite background positioning with setInterval -- that animation would require 10 setIntervals doing repainting of the DOM for sprite background-position shifts. Wouldn't that be a big buggy? I was wondering if there was a way around all this, perhaps using Canvas, so that animations can all happen concurrently without creating an event queue and I don't have to worry about timers. Hope that makes sense, and please let me know if I need to clarify further.

    Read the article

  • Dissapearing object function??

    - by WmasterJ
    Is there a reason for object functions to be unset or deleted or simply not applied for any reason at all that isn't intentional? I am maintaining someone elses code and gone through it many times. I use Google Chromes awesome debuger and also TextMate. These help me find the origin of error relatively fast. The problem I have now is that i have an object: types. This object conatains...types. And these types have functions and other variables attached to them. For some reason in the middle of the code, this type has been passed by reference millions of times probably. When it comes to a certain part of the code parts of it, seem to have dissapeared. Puff! And it's gone..! Anyone have a clue (other than it being removed somewhere else earlier in the code, I'm already looking for that)

    Read the article

  • Validation of textarea

    - by Hulk
    How to validate a textarea in a form.i.e, it should not be empty or have any new lines and if so raise an alert <script> function val() { //ifnewline found or blank raise an alert } </script> <form> <textarea name = "pt_text" rows = "8" cols = "8" class = "input" WRAP ></textarea> <input type=""button" onclick="val();" </form> Thanks

    Read the article

  • i want to call the function when i clicked on the checkbox using prototype.js.here obj[i] contents j

    - by vicky
    DeCheBX = $('MyDiv').insert(new Element('input', { 'type': 'checkbox', 'id': "Img" + obj[i].Nam, 'value': obj[i].IM, 'onClick': SayHi(this) })); document.body.appendChild(DeCheBX); DeImg = $('MyDiv').insert(new Element('img', { 'id': "Imgx" + obj[i].Nam, 'src': obj[i].IM })); document.body.appendChild(DeImg); } SayHi = function(x) { try { if($(x).checked == true) { alert("press" + x); } } catch (e) { alert("error");

    Read the article

  • jquery question for events

    - by OM The Eternity
    I have to copy the text from one text box to another using checkbox through jquery I have applied jquery event in my code, it works partially correct.. code is as follows: <html> <head> <script src="js/jquery.js" ></script> </head> <body> <form> <input type="text" name="startdate" id="startdate" value=""/> <input type="text" name="enddate" id="enddate" value=""/> <input type="checkbox" name="checker" id="checker" /> </form> <script> $(document).ready(function(){ $("#startdate").change(function(o){ if($("#checker").is(":checked")){ $("#enddate").val($("#startdate").val()); } }); }); </script> </body> </html> this code works as follows, I always have checkbox checked by default hence whenever i insert the start date and then tab, the start date gets copied to enddate. My Problem but now if uncheck the checkbox and change the start date and then recheck the check box, the start date is not copied, Now what should be done in this situation.. please help me....

    Read the article

  • Which JavaScript MVC framework to use for wysiwyg editing and floating context-sensitive settings pa

    - by ernests
    I'm developing a cms that allows editing everything on the page (generated server-side with a template engine) by just clicking on it — the area turns into input field, textarea or a full-featured tinyMCE editor, Template defines editable elements like "page heading", "copyright footer text", "image", "rich text block" etc. Along with that there's always a flotaing panel with several tabs, some of which contain general settings like page bacground color, font settings etc, but some are context sensitive (e.g., the clicking on "image" editable field triggers to display uploading/cropping/captioning interface in the floating panel). All settings in the panel are either simple inputs or sliders or checkboxes. I'm new to using MVC with javascript, and in fact haven't used it much before. jQuery is used as code library for the project. Should i use JavascriptMVC, SproutCore or anything else? Does any of them allow some kind of sandboxing (within bounds of commmon sense) to allow some javascript code by user-generated skins on my cms? thank you!

    Read the article

  • Manipulate multiple check boxes by ID using unobtrusive java script?

    - by Dean
    I want to be able to select multiple check boxes onmouseover, but instead of applying onmouseover to every individual box, I've been trying to work out how to do so by manipulating check boxes by ID instead, although I'm not sure where to go from using getElementById,. So instead of what you see below. <html> <head> <script> var Toggle = true; var Highlight=false; function handleKeyPress(evt) { var nbr; if (window.Event) nbr = evt.which; else nbr = event.keyCode; if(nbr==16)Highlight=true; return true; } function MakeFalse(){Highlight=false;} function SelectIt(X){ if(X.checked && Toggle)X.checked=false; else X.checked=true; } function ChangeText() { var test1 = document.getElementById("1"); test1.innerHTML = "onmouseover=SelectIt(this)" } </script> </head> <body> <form name="A"> <input type="checkbox" name="C1" onmouseover="SelectIt(this)" id="1"><br> <input type="checkbox" name="C2" onmouseover="SelectIt(this)" id="2"><br> <input type="checkbox" name="C3" onmouseover="SelectIt(this)" id="3"><br> <input type="checkbox" name="C4" onmouseover="SelectIt(this)" checked="" disabled="disabled" id="4"><br> <input type="checkbox" name="C5" onmouseover="SelectIt(this)" id="5"><br> <input type="checkbox" name="C6" onmouseover="SelectIt(this)" id="6"><br> <input type="checkbox" name="C7" onmouseover="SelectIt(this)" id="7"><br> <input type="checkbox" name="C8" onmouseover="SelectIt(this)" id="8"><br> </form> </body> </html> I want to be able to apply the onmousover effect to an array of check boxes like this <form name="A"> <input type="checkbox" name="C1" id="1"><br> <input type="checkbox" name="C2" id="2"><br> <input type="checkbox" name="C3" id="3"><br> <input type="checkbox" name="C4" checked="" disabled="disabled" id="4"><br> <input type="checkbox" name="C5" id="5"><br> <input type="checkbox" name="C6" id="6"><br> <input type="checkbox" name="C7" id="7"><br> <input type="checkbox" name="C8" id="8"><br> </form> After trying the search feature of stackoverflow.com and looking around on Google I haven't been able to a find a solution that makes sense to me thus far, although I'm still in the process of learning so I fear I might be trying to do something too advanced for my level of knowledge.

    Read the article

  • how do I automatically execute javascript?

    - by user317005
    how do I automatically execute javascript? I know of < body onLoad="" , but I just thought maybe there is another way to do it? html: <html><head></head><body><div id="test"></div></body></html> javascript: <script>(function(){var text = document.getElementById('test').innerHTML;var newtext = text.replace('', '');return newtext;})();</script> I wanna get the text within "test", replace certain parts, and then output it to the browser. Any ideas on how to do it? I'd appreciate any help. Thanks.

    Read the article

  • Why wont this JS code work if its all on the same line?

    - by culov
    I'm writing HTML code for a java servlet. i first write the code in html/js so i can debug what im working on, and then ill make it a java string and put it in my servlet. My problem is that the code is working fine when i view it in ff from a local html file, but when i view it on my java servlet, it doesnt work because the js isnt getting called. what I did was format the html that my servlet generated so that its not all on a single line and ran the code again. This time it worked. I copied this working code into a browser address bar so that it will all be on a single line, and copied that code back into the script in my html file. Now, when the previously working code is on a single line, it doesnt work. Here's the formatted JS: var sMax var holder; var preSet; var rated; var request; function rating(num){ sMax = 0; for(n=0; n<num.parentNode.childNodes.length; n++){ if(num.parentNode.childNodes[n].nodeName == "A"){ sMax++; } } if(!rated){ s = num.id.replace("_", ''); a = 0; for(i=1; i<=sMax; i++){ if(i<=s){ document.getElementById("_"+i).className = "on"; document.getElementById("rateStatus").innerHTML = num.title; holder = a+1; a++; }else{ document.getElementById("_"+i).className = ""; } } } } function off(me){ if(!rated){ if(!preSet){ for(i=1; i<=sMax; i++){ document.getElementById("_"+i).className = ""; document.getElementById("rateStatus").innerHTML = me.parentNode.title; } }else{ rating(preSet); document.getElementById("rateStatus").innerHTML = document.getElementById("ratingSaved").innerHTML; } } } function rateIt(me){ if(!rated){ document.getElementById("rateStatus").innerHTML = document.getElementById("ratingSaved").innerHTML + " "+me.title; preSet = me; rated=1; sendRate(me); rating(me); } } function sendRate(sel){ alert("Your rating was: "+sel.title); addRating("rating", "?truck=kogibbq?rating="+ sel.id); } function addRating(servletName, servletArguments){ var servlet = servletName; var arg = servletArguments var req = servlet + arg; alert(req); addrequest(req); request.onreadystatechange = function(){ alert("response received"); } } function addrequest(req) { try { request = new XMLHttpRequest(); }catch (e) { try { request = new ActiveXObject("Microsoft.XMLHTTP"); }catch (e) { alert("XMLHttpRequest error: " + e); } } request.open("GET", element, true); request.send(null); return request; } Thanks.

    Read the article

  • Javascript debugging: stopping/breaking at every javascript invocation

    - by portoalet
    I am dealing with a complex legacy javascript code base, and it's difficult to figure out where to put breakpoint (I have to find the files, put a breakpoint in firebug etc). Is there a way so that Firebug breaks on the first javascript execution that it encounters every time? In other words, every time I click on something on the page, and if a javascript code is executed, I want Firebug to break on that line? Of course I don't want Firebug to stop when it executes it's internal javascript. Is this possible?

    Read the article

  • Printing contents of a div

    - by Hulk
    The contents of the following div re derived dynamically. i.e, A table is added dynamically to this div with some button .My question is how to print the content of this div(window.print) and not other things in the page <div id="newdiv" name="newdiv"></div> Thanks..............

    Read the article

  • Javascript dispatchEvent

    - by xpepermint
    Hey... I'm using Flash a lot and my classes uses EventDispatcher class which allowes me to define custom events of a class. How can I do this in javascript. I would like to do something like this: var MyClass = function() { }; MyClass.prototype = { test : function() { dispatchEvent('ON_TEST'); } }; var mc = new MyClass(); mc.addEventListener('ON_TEST', handler); function handler() { alert('working...') } How is this posible with Javascript?

    Read the article

  • Javascript Close Browser or goto external site function

    - by aaroninfidel
    Hello, I've been trying to figure out how I can go about creating a javascript function that will only be called when a user is accessing an external site or closing the window to the current site they're on. So far I've come up with this, any help is greatly appreciated. <script type="text/javascript"> window.onbeforeunload = confirmExit; function getAd() { var myAds = new Array(); myAds[0] = "http://localhost/link1"; myAds[1] = "http://localhost/link2"; var randomAd = Math.floor(Math.random() * myAds.length); return myAds[randomAd]; } function confirmExit(){ alert(getAd()); return false; } </script>

    Read the article

  • how to create run time element? where i am doin wrong help....help.....

    - by vicky
    new Ajax.Request('Handler.ashx', { method: 'get', onSuccess: function(transport) { var response = transport.responseText || "no response text"; //alert("Success! \n\n" + response); var obj = response.evalJSON(true); alert(obj[0].Nam); alert(obj[0].IM); for(i = 0; i < 4; i++) { $('MyDiv').insert( new Element('checkbox', { 'id': "Img" + obj[i].Nam, 'value': obj[i].IM }) ); return ($('MyDiv').innerHTML); } }, onFailure: function() { alert('Something went wrong...') } });

    Read the article

  • How do I create a random method name

    - by Russ Bradberry
    I plan on using JSONP to call an external webservice to get around the fact that I dont want to create a global function that could potentially conflict with the calling page. I thought that creating a random function name and passing it up would work. Something like this: <script src="www.foo.com/b?cb=d357534"> where cb is the callback function name, the server would return d357534({my json data}); what i want to know is how to create the random function name, im sure i could use eval but is this the best way to go about it? essentially, what i am trying to do is this: var d + Math.floor(Math.random()*1000001) = function(){...

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >