Search Results

Search found 23794 results on 952 pages for 'serverside javascript'.

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

  • Filling in a form client-side [Javascript]

    - by Hawker
    I'm coding up a small Vista/7 sidebar gadget for our web based employee schedule system and I've run into a Javascript problem that my Google-FU can't solve. I can't figure out how to fill in a login form from the client. I'm creating a new ActiveXObject, navigating to the site, but lost as to where to go from here. var conn = new ActiveXObject("Microsoft.XMLHTTP"); conn.open("POST", "url", false); conn.send(null); Can access the form from the ActiveXObject based on the form id? I'd also assume I'm going to need to change a few headers for a POST vs. a GET? Thanks for any tips or links to references! I can't seem to find much and JavaScript isn't my forte.

    Read the article

  • Running javascript in AJAX loaded DIV

    - by WiseDonkey
    I have page loading, via AJAX a PHP page into a div. In turn, this loaded page has it's own javascript and AJAX loaded div. Reason is to allow user to select data alter data within loaded data. I'm trying to do this without the help of JSON or such to communicate between JS and PHP. I'm guessing the parent calling page has already loaded the javascript, and the AJAX loaded content can't access that? (I've tried running the JS into the AJAX loaded content as well) If so, is there anyway to access that?

    Read the article

  • how to get the image id and use hiding the image using prototype js?

    - by patel
    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) {

    Read the article

  • Alert is showing two times. how to restrict?

    - by Dev
    function test(myObject, flag) { if ( (flag) || ((event.keyCode == 59) || (event.which == 59)) || ((event.keyCode == 44) || (event.which == 44))) {alert(myObject.value);} } function closeWin() {self.close();} --foaram name='test' --textaarea name='textareaName' cols='44' rows='3' onChange='test(this, true);' --onKeyPress='test(this);' onBlur='test(this, true);' ---inpaut type='text' name='textName' --inpaut type='button' name='buttonName' onclick='closeWin();' value='Cancel' --/foarm I have a problem: when input value(e.g: test;) into textareaName field, the test function is always run more one time. Please show me the way can run this only one time.

    Read the article

  • Keep a javascript variable after an ajax call

    - by Guillaume le Floch
    I'm new in javascript and jQuery. I'm using ajax calls to get data from my server. The fact is, I'm losing my javascript variables after the call .. Here is what I did : the variable is define outside any function and treat in an other function. var a = 0; function myfunction(url){ $.ajax({ url: url, timeout: 20000, success: function(data){ // Do some stuff // The a variable is now undefined }, error: function(){ // Do some stuff } }); } Everything is working fine, the only thing is that I need to keep my variables ... but it looks like it's gone .. Does anyone know why? Thanks

    Read the article

  • What does addListener do in node.js?

    - by Jeffrey
    I am trying to understand the purpose of addListener in node.js. Can someone explain please? Thanks! A simple example would be: var tcp = require('tcp'); var server = tcp.createServer(function (socket) { socket.setEncoding("utf8"); socket.addListener("connect", function () { socket.write("hello\r\n"); }); socket.addListener("data", function (data) { socket.write(data); }); socket.addListener("end", function () { socket.write("goodbye\r\n"); socket.end(); }); }); server.listen(7000, "localhost");

    Read the article

  • Javascript unload page condition

    - by Stapped
    hello, I am using the following code to prompet the user that if he left the page he can't come back. Things happened that i want to redirect the page using setTimeout function after a specific time. I want to disable checking for user leaving the page when the automatic redirection starts. <script language="javascript" type="text/javascript"> needToConfirm = true; window.onbeforeunload = askConfirm; function askConfirm(){ if (needToConfirm){ return "Please note that you might not be able to come back and watch the movie again."; } } </script>

    Read the article

  • Access ASP.NET control using javascript

    - by user3036965
    I have a basic javascript function like this which works as I am able to dynamically change the textbox in a javascript method at runtime. function MyTst(pVal2) { var x = document.getElementById('<%=myImage.ClientID%>'); x.src = "/images/write.gif"; } In the above code I need to be generic. So replace '<%=myImage.ClientID%' with the input param to my method which in this instance is called pVal2 and contains the asp.net server control image id. Can anyone advise on an approach to do this. I've tried lots of things and just cant seem to get it working. Thanks for any advice.

    Read the article

  • .focus() doesn't work on an input while orher attributes works

    - by Sirber
    I have a classic table / thead / tbody structure, which I add a line at the end of the tbody. The line contains only an input element. The code works in Firefox 3.6 but not in Chrome v5 or IE8. I'm using jQuery 1.4.1. Does not work: $("#" + AJAX_ID).parent().find('tr:last > td:nth-child(2) > input').focus(); Does work: $("#" + AJAX_ID).parent().find('tr:last > td:nth-child(2) > input').css('background-color', 'red'); even setting an ID on the input, and using document.getElementBuId('id').focus() doesn't work. Thank you!

    Read the article

  • What are the drawbacks of this Classing format?

    - by Keysle
    This is a 3 layer example of my classing format function __(_){return _.constructor} //class var _ = ( CLASS = function(){ this.variable = 0; this.sub = new CLASS.SUBCLASS(); }).prototype; _.func = function(){ alert('lvl'+this.variable); this.sub.func(); } _.divePeak = function(){ alert('lvl'+this.variable); this.sub.variable += 5; } //sub class _ = ( __(_).SUBCLASS = function(){ this.variable = 1; this.sub = new CLASS.SUBCLASS.DEEPCLASS(); }).prototype; _.func = function(){ alert('lvl'+this.variable); this.sub.func(); } //deep class _ = ( __(_).DEEPCLASS = function(){ this.variable = 2; }).prototype; _.func = function(){ alert('lvl'+this.variable); } Before you blow a gasket, let me explain myself. The purpose behind the underscores is to accelerate the time needed to specify functions for a class and also specify sub classes of a class. To me it's easier to read. I KNOW, this does interfere with underscore.js if you intend to use it in your classes. I'm sure _.js can be easily switched over to another $ymbol though ... oh wait, But I digress. Why have classes within a class? because solar.system() and social.system() mean two totally different things but it's convenient to use the same name. Why user underscores to manage the definition of the class? because "Solar.System.prototype" took me about 2 seconds to type out and 2 typos to correct. It also keeps all function names for all classes in the same column of texts, which is nice for legibility. All I'm doing is presenting my reasoning behind this method and why I came up with it. I'm 3 days into learning OO JS and I am very willing to accept that I might have messed up.

    Read the article

  • Call javascript function from Java (Groovy) class

    - by ashkanr
    Hi, I have a javascript function (very big one!) that I need its functionality in a Java (Groovy) class. It is a simple calendar converter. I can rewrite it in groovy but just want to know if it is possible to call javascript function from a java (groovy) method? I guess functional testing libraries like selenium and Canoo should have something like this, am I right? PS: I don't want to wake up a real-world browser in order to use its JS runtime env. Thanks,

    Read the article

  • Alt attribute encoding with JavaScript

    - by MainMa
    Hi, Html entities must be encoded in alt attribute of an image in HTML page. So <img id="formula" alt="A &rarr; B" src="formula.png" /> will work well. On the other hand, the same JavaScript code will not work document.getElementById('formula').alt = 'A &rarr; B'; and will produce A &rarr; B instead of A → B. How to do it through JavaScript, when it is not possible to put the special (unencoded) characters in the source code?

    Read the article

  • javascript popup on refreshing page

    - by vatismarty
    I have written code like this to throw a pop up when my website is closed. But this throws the pop up even if i refresh my page. Please help me to throw popup only when i close the browser of that website. <body onunload="javascript: exitpop()"> <script type="text/javascript"> function exitpop() { my_window= window.open ("","mywindow1","status=1,width=600,height=400"); my_window.document.write('<h1>My Team</h1><p>Thank you</p><p>If you accidentally closed website click <a href="http://www.google.com">here</a> to go back to our website</p>'); }.

    Read the article

  • Populate javascript array with PHP array of Variables

    - by user1704514
    The following code is used to populate a pie chart in javascript: <script type="text/javascript"> var agg = { label: 'Aggressive', pct: [60, 10, 6, 30, 14, 10] }, bal = { label: 'Balanced', pct: [24, 7, 2, 18, 13, 36] }, mod = { label: 'Moderate', pct: [12, 4, 2, 10, 11, 61] }, inc = { label: 'Income', pct: [ 0, 0, 0, 0, 0,100] }, </script> Instead of tm: [40, 60, 67, 30, 74, 50] as seen above, I would like to make each of 6 values a php variable. Like: tm: [$r1, $r2, $r3, $r4, $r5, $r6] . How do I do this? How do I do this with? A php array or json encode?

    Read the article

  • How can I write faster JavaScript?

    - by a paid nerd
    I'm writing an HTML5 canvas visualization. According to the Chrome Developer Tools profiler, 90% of the work is being done in (program), which I assume is the V8 interpreter at work calling functions and switching contexts and whatnot. Other than logic optimizations (e.g., only redrawing parts of the visualization that have changed), what can I do to optimize the CPU usage of my JavaScript? I'm willing to sacrifice some amount of readability and extensibility for performance. Is there a big list I'm missing because my Google skills suck? I have some ideas but I'm not sure if they're worth it: Limit function calls When possible, use arrays instead of objects and properties Use variables for math operation results as much as possible Cache common math operations such as Math.PI / 180 Use sin and cos approximation functions instead of Math.sin() and Math.cos() Reuse objects when passing around data instead of creating new ones Replace Math.abs() with ~~ Study jsperf.com until my eyes bleed Use a preprocessor on my JavaScript to do some of the above operations

    Read the article

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