Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
T

Ted K 1

@Ted K 1
About
Posts
7
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • The problem of JavaScript position
    T Ted K 1

    Dear All, I got a question! why can't i put the script code after the div with class="jumbotorn" ? I have tried to put it in the , and it's work! Please helps me! THANKS!

    <body>
    <div class="jumbotron">
    <div align="center">
    <h1 style="font-family:微軟正黑體;">行銷神語</h1>
    <p id="pharse"></p>
    <p><a class="btn btn-primary btn-lg" href="#" role="button">Learn more</a></p>
    </div>
    </div>

    <script>
    	function makePharse(){
    		var word1 = \["24/7","Multi-Tier","30,000 foot","B-to-B","Win-Win","Customer"\];
    		var word2 = \["Empowered","Value-Added","Oriented","Focused","Aligned"\];
    		var word3 = \["Process","Solution","Tipping-Point","Strategy","Vision"\];
    		var rand1 = Math.floor(Math.random()\*word1.length);
    		var rand2 = Math.floor(Math.random()\*word2.length);
    		
    		var pharse = word1\[rand1\]+""+word2\[rand2\]+"";
    		var pharseElement = document.getElementById("pharse");
    		pharseElement.innerHTML = pharse;
    		pharseElement.innerHTML = "TESt";
    		
    	}
    	
    
    </script>
    

    </body>

    JavaScript question javascript sales tools help

  • How to deal with Uncaught TypeError?
    T Ted K 1

    thanks a lot! it works! ;)

    JavaScript tools help tutorial question

  • How to control the do / while infinite loop?
    T Ted K 1

    ;) really useful! thanks a lot!

    JavaScript javascript help tutorial question

  • How to control the do / while infinite loop?
    T Ted K 1

    :) really useful! thanks a lot!

    JavaScript javascript help tutorial question

  • How to control the do / while infinite loop?
    T Ted K 1

    :) really useful! thanks a lot!

    JavaScript javascript help tutorial question

  • How to control the do / while infinite loop?
    T Ted K 1

    Dear all, it's my simple JS program. I can't figure out that why can't i stop the loop by using "guess==null". Please help!!

    var target = prompt("Please enter a number small than 50:");

        var guess = "";
        var time = 0;
    
        /\*
        var guess2 = prompt("111");
        var guess3 = window.prompt("222",guess3);
        document.write(typeof(guess));
        document.write(typeof(guess2));
        document.write(typeof(guess3));
        \*/
    
        do{
            guess = prompt("Please Guess:");
            if(guess == target || guess == null){
                break;
            }
    
            if(guess < target){
                alert("bigger!");
                time++;
                continue;
            }else{
                alert("smaller!");
                time++;
                continue;
            }
        }while(true)
    
        if(guess==null){
            document.write("the answer is:"+target);
        }else{
            document.write("Good!共猜了:"+(time+1));
        }
    
    JavaScript javascript help tutorial question

  • How to deal with Uncaught TypeError?
    T Ted K 1

    /*
    Dear all,

    <!-- code -->
    <script>
    function Array2D(x,y){
    this.length = x*y;
    this.x = x;
    this.y = y;

            for(var i=0 ; i<this.length ; i++){
                this\[i\] = null;  
            }
            this.get = function(x,y){ 
                return this\[x\*this.x+y\];
            }
            this.set = function(x,y,value){ 
                this\[x\*this.x+y\] = value;
    
            }
        }
    

    </script>

    <script>
    var a2d = Array2D(10,10);
    a2d.set(2,3,"2");
    alert(this.get(1,2));
    </script>
    <!-- end code -->

    <!-- error message -->
    Uncaught TypeError: Cannot read property 'set' of undefined

    How does it happen?and what should i do to avoid this?
    */

    JavaScript tools help tutorial question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups