브 라 우 저가 서버 에 요청 하 는 일반적인 방식

요약 하면 어떤 방법 으로 브 라 우 저 를 통 해 서버 에 요청 할 수 있 습 니까?
  • 1. 양식 form 의 제출.
  • 2. 하이퍼링크.
  • <a href="http://localhost:8080/oa/save?username=zhangsan&password=123">           a>
    
  • 3、document.location \ document.location.href
  • 4、window.location \ window.location.href
  • 5、window.open(“url”)
  • 6. 브 라 우 저 주소 표시 줄 에 URL 을 입력 하고 차 로 돌아 갑 니 다.(이것 도 수 동 으로 입력 할 수 있 고 제출 데이터 도 동적 이 될 수 있 습 니 다.
  • 이상 의 요청 방식 은 서버 에 데 이 터 를 휴대 할 수 있 으 며 폼 을 통 해 제출 한 데이터 만 동적 입 니 다.
    
    <html>
    <head>
        <meta charset="utf-8">
        <title>          URLtitle>
    head>
    <body>
    
    <script type="text/javascript">
        function goBaidu(){
          
            //var locationObj = window.location;
            //locationObj.href = "http://www.baidu.com";
    
            // window.location.href = "http://www.jd.com";
            // window.location = "http://www.126.com";
    
            //document.location.href = "http://www.sina.com.cn";
            document.location = "http://www.tmall.com";
        }
    script>
    
    <input type="button" value="  " onclick="goBaidu();"/>
    
    <input type="button" value="baidu" onclick="window.open('http://www.baidu.com');" />
    
    body>
    html>
    

    좋은 웹페이지 즐겨찾기