JavaScript 1.7使我的代码无效

时间:2015-10-25 00:22:59

标签: javascript jquery

当jfiddle语言是javascript而不是javascript 1.7时,此代码可以在Jfiddle中运行。它也没有在实际网站的文本框中放置任何内容。它应该接受用户输入并返回一个数字。我是网络开发的新手,所以任何帮助都会很棒。



$('#teambtn').click(function() {

var Domain = $("#domain option:selected").val();
var Mobile = $("#Mobile option:selected").val();
var Pages = document.getElementById("pages").value;
Domain = Domain * 1;
Mobile = Mobile * 1;
Pages = Pages * 1;
var Result = ((10 + (Pages*5)) * Mobile) + Domain;
Result = Result + '';
$('textarea#team').text(Result);
});

<!DOCTYPE html>
<html lang="en">
	<head>
		<title>Oktoberfest</title>
		<meta charset="utf-8">
		<meta name = "format-detection" content = "telephone=no" />
		<link rel="icon" href="images/favicon.ico">
		<link rel="shortcut icon" href="images/favicon.ico" />
		<link rel="stylesheet" href="css/style.css">
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
        <script src="index.js"></script>
	</head>
	<body class="" id="top">
		<div class="main">
<!--==============================header=================================-->
		<header>
			
		
				<div class="menu_block ">
					
							<div id="navigation">
							<nav class="horizontal-nav full-width horizontalNav-notprocessed">
								
								  <center>
								    <img src="http://i.imgur.com/JVMX4YH.png"/>
								    <a href="index.html">Home</a>
									<a href="index-1.html">About</a>
									<a href="index-2.html">Hire Us</a>
									<a href="index-3.html">Price Esimator</a>
									<!--<a href="index-4.html">Photos</a>-->
									<!--<a href="index-5.html">Testimonials</a>-->
									<a href="index-6.html">Resources</a>
								    <a href="index-7.html">Tutorials</a>
								</center>
								
							</nav>
							</div>
							<div class="clear"></div>
						</div>
			
			
				<div class="container_12">
					
				</div>
				<div class="clear"></div>
			</header>
<!--==============================Content=================================-->
		<br><br><br>
			<div class="content">
				<div class="container_12">
$('#teambtn').click(function() {

var Domain = $("#domain option:selected").val();
var Mobile = $("#Mobile option:selected").val();
var Pages = document.getElementById("pages").value;;
Domain = Domain * 1
Mobile = Mobile * 1
Pages = Pages * 1
var Result = ((10 + (Pages*5)) * Mobile) + Domain;
Result = Result + ''
$('textarea#team').text(Result);
});
</script>  
    				    
<center>
Domain Suffix&nbsp;
        <select id="domain">
                <option value = "10">.com</option>
                <option value = "10">.org</option>
                <option value = "7.5">.net</option>
                <option value = "0">.tk or another domain</option>
             
    </select>       <br />    <br/>
    Do you want a mobile version of your site.&nbsp;
    <select id="Mobile">
                <option value = "1">No</option>
                <option value="1.5">Yes</option>    
    </select>

<br /><br />
            How many Pages will your site have (imput a whole number) :&nbsp;<input type="text" name="hp evs"id='pages' size="5" value ="1">

<br /><br />
            <textarea id=team cols="50" rows="10"></textarea>
            <div class="mybutton" id="mybutton">
            <button id="teambtn" size="30" >Export</button>
      
  <br /> 
    <br /> 
      <br /> 
        <br /> 
          <br /> 
            <br /> 
              <br /> 
                <br /> 
                  <br /> 
                    <br /> 



                    </div>   
				    
				</center></div></div></div>
	
          
	
<!--==============================footer=================================-->
					<footer>Contact Us - (847)967-1184 Email - frankkmusic@gmail.com | <a href="https://github.com/Kingdiepie/Frankkmusic/blob/master/LICENSE">LICENSE</a><br><a href="https://www.gigmasters.com/german-band/frank-k--company">Gigmaster</a>|<a href="https://www.gigsalad.com/frank_k_company_morton_grove">Gigsalad</a>|<a href="https://www.facebook.com/FrankKDuoCompany">Facebook</a></footer>
	</body>
</html>
&#13;
&#13;
&#13;

enter code here https://jsfiddle.net/67y57kyb/1/

0 个答案:

没有答案