SitePoint Sponsor

User Tag List

Results 1 to 9 of 9

Threaded View

  1. #1
    SitePoint Member
    Join Date
    Aug 2013
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to merge, combine two different functions in javascript?

    Hello, world! I need help on something.I am new in javascript and have two different scripts to merge, combine or whatever they call it:

    Code:
    function doSomething() {}
    
    (function loop() {
    var rand = Math.round(Math.random() * (30000 - 1000)) + 1000;
    setTimeout(function() {
    alert('A');
    doSomething();
    loop(); 
    }, rand);
    }());
    
    And this one:
    
    var win=null;
    function NewWindow(mypage,myname,w,h,scroll,pos){
    if(pos=="random"){LeftPosition=(screen…
    if(pos=="center"){LeftPosition=(screen…
    else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20…
    settings='width='+w+',height='+h+',top…
    win=window.open(mypage,myname,settings…
    Can someone help me on this matter?

    Many thanks to everyone.
    Last edited by Pullo; Sep 1, 2013 at 02:52. Reason: Added code tags


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •