douliexing2195
2014-02-12 23:43
浏览 23
已采纳

搜索机器人在查找/索引来自onclick事件的PHP代码中的此链接时会遇到问题吗?

I wanted to make my site use more PHP in order to save space on HTML code and I wanted to try using this code to make a menu that would launch different divs containing different pages or information per se, I was wondering if search bots would have difficulty navigating such a maze because of php or Javascript or both?

Here's the code,

<?php
 if($_GET['button1']){fun1();}
 if($_GET['button2']){fun2();}

 function fun1()
 {
   //creates a div with a link to google
    echo'<a href = "http://www.google.com"><div style = "height:100px; width:20px; top:100px; left:100px; background-color: black;"></div></a>';   
 }
 function fun2()
 {
 //creates a div with a link to yahoo
   echo'<a href = "http://www.yahoo.com"><div style = "height:200px; width:40px; top:200px; left:200px; background-color: red;"></div></a>';
 }
?>

<!DOCTYPE html>
<html lang="en">
  <head>
    <title></title>
  </head>
  <body>
    <button id="btnfun1" name="btnfun1" onClick='location.href="?button1=1"'>Update to 1</button>
    <button id="btnfun2" name="btnfun2" onClick='location.href="?button2=1"'>Update to 2</button>
  </body>
</html>
  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题