zoukankan      html  css  js  c++  java
  • 让您的网站拥有MSDN资源库搜索功能[转摘MSDN]

    方式一

    在您需要添加MSDN搜索链接的地方添加以下代码:

    <script language="Javascript" src="http://www.microsoft.com/china/msdn/search/msdn_search.js">
    </script>
    

    使用以上代码,产生的搜索样式如下图所示:

    MSDN搜索样式


    注:使用以上代码,将始终使用默认方式引用MSDN搜索链接,无需也无法定制。另外使用这种方式引用MSDN搜索链接,当MSDN搜索代码有变化时,您不需要再重新修改您的网页代码,因此更加方便和准确。

    方式二

    直接将以下代码添加到您所需要使用MSDN搜索链接的地方:

    <table border="0" cellpadding="2" cellspacing="4" bgcolor="#E5EAED">
    <tr>
    <form method="get" action="http://www.microsoft.com/china/msdn/searchredir.aspx">
    <td width="52"><img src="http://www.microsoft.com/china/msdn/search/msdn_masthead.gif"></td>
    <td><input name="qu" type="text" size="30"></td>
    <td><input type="submit" name="Submit" value="搜索MSDN"></td>
    </form>
    </tr>
    </table>
    

    您可以根据自己的喜好自由定制搜索的文字、背景颜色等风格。但是以下三个地方请注意:

    1.

    “form” 标记中的“method”方法必须是“get”;

    2.

    “form” 标记中的“action”必须是http://www.microsoft.com/china/msdn/searchredir.aspx;

    3.

    搜索关键字输入框(input标记)的名称(name)必须为“qu”。

    另外,我们为您提供了三种不同的MSDN徽标图片,供您选择使用:

    MSDN徽标

    msdn_masthead_small.gif

    msdn_masthead_medium.gif

    msdn_masthead.gif

    方式三

    MSDN搜索的URL格式为:

    http://www.microsoft.com/china/msdn/searchredir.aspx?qu=搜索关键字
    

    如果您非常熟悉HTML和动态网页制作,有了上面的URL格式,您将非常容易地写出您需要的网页代码来。只需将需要搜索的关键字作为参数传给http://www.microsoft.com/china/msdn/searchredir.aspx这个页面即可。

    让您的网站集成MSDN中文网站丰富的资源,更好的为广大开发者服务。

  • 相关阅读:
    grunt in webstorm
    10+ Best Responsive HTML5 AngularJS Templates
    响应式布局
    responsive grid
    responsive layout
    js event bubble and capturing
    Understanding Service Types
    To add private variable to this Javascript literal object
    Centering HTML elements larger than their parents
    java5 新特性
  • 原文地址:https://www.cnblogs.com/willpower/p/19151.html
Copyright © 2011-2022 走看看