AJax¼¼Êõ

ʹÓÃajax¿çÓòwithCredentialsµÄ×÷ÓÃ

×ÖºÅ+ ×÷ÕߣºH5Ö®¼Ò À´Ô´£ºH5Ö®¼Ò 2016-03-26 16:03 ÎÒÒªÆÀÂÛ( )

±¾ÆªÎÄÕÂÖ÷Òª½éÉÜÁËʹÓÃajax¿çÓòwithCredentialsµÄ×÷Ó㬶ÔÓÚJavascript½Ì³ÌÓÐÐËȤµÄͬѧ¿ÉÒԲο¼Ò»Ï¡£

ĬÈÏÇé¿öÏ£¬¿çÔ´ÇëÇó²»Ìṩƾ¾Ý(cookie¡¢HTTPÈÏÖ¤¼°¿Í»§¶ËSSLÖ¤Ã÷µÈ)¡£Í¨¹ý½«withCredentialsÊôÐÔÉèÖÃΪtrue£¬¿ÉÒÔÖ¸¶¨Ä³¸öÇëÇóÓ¦¸Ã·¢ËÍƾ¾Ý¡£Èç¹û·þÎñÆ÷½ÓÊÕ´øƾ¾ÝµÄÇëÇ󣬻áÓÃÏÂÃæµÄHTTPÍ·²¿À´ÏìÓ¦¡£

true

Èç¹û·¢Ë͵ÄÊÇ´øƾ¾ÝµÄÇëÇ󣬵«·þÎñÆ÷µÄÏàÓ¦ÖÐûÓаüº¬Õâ¸öÍ·²¿£¬ÄÇôä¯ÀÀÆ÷¾Í²»»á°ÑÏàÓ¦½»¸øJavaScript(ÓÚÊÇ£¬responseTextÖн«ÊÇ¿Õ×Ö·û´®£¬statusµÄֵΪ0£¬¶øÇÒ»áµ÷ÓÃonerror()ʼþ´¦Àí³ÌÐò)¡£ÁíÍ⣬·þÎñÆ÷»¹¿ÉÒÔÔÚPreflightÏìÓ¦Öз¢ËÍÕâ¸öHTTPÍ·²¿£¬±íʾÔÊÐíÔ´·¢ËÍ´øƾ¾ÝµÄÇëÇó¡£

Ö§³ÖwithCredentialsÊôÐÔµÄä¯ÀÀÆ÷ÓÐFirefox 3.5+¡¢Safari 4+ºÍChrome¡£IE10¼°¸üÔç°æ±¾¶¼²»Ö§³Ö¡£

From£º

²Î¿¼£º

¡¡

1.±¾Õ¾×ñÑ­ÐÐÒµ¹æ·¶£¬ÈκÎתÔصĸå¼þ¶¼»áÃ÷È·±ê×¢×÷ÕߺÍÀ´Ô´£»2.±¾Õ¾µÄÔ­´´ÎÄÕ£¬ÇëתÔØʱÎñ±Ø×¢Ã÷ÎÄÕÂ×÷ÕߺÍÀ´Ô´£¬²»×ðÖØÔ­´´µÄÐÐΪÎÒÃǽ«×·¾¿ÔðÈΣ»3.×÷ÕßͶ¸å¿ÉÄܻᾭÎÒÃDZ༭Ð޸Ļò²¹³ä¡£

Ïà¹ØÎÄÕÂ
  • Ajax ajax¾Ö²¿Ë¢ÐÂ

    Ajax ajax¾Ö²¿Ë¢ÐÂ

    2016-03-30 14:02

  • pythonÅÀ³æѧϰ£¨Áù£©requests ¹ØÓÚcookieµÄ¿°Îó

    pythonÅÀ³æѧϰ£¨Áù£©requests ¹ØÓÚcookieµÄ¿°Îó

    2016-03-25 21:13

  • pythonÅÀ³æѧϰ£¨Ò»£©·ÖÎöajaxÇëÇó FindSpace

    pythonÅÀ³æѧϰ£¨Ò»£©·ÖÎöajaxÇëÇó FindSpace

    2016-03-24 18:00

  • EXT.NETѧϰ±Ê¼Ç£¨Ò»£© ÏÂÔØÅäÖÃʹÓÃ

    EXT.NETѧϰ±Ê¼Ç£¨Ò»£© ÏÂÔØÅäÖÃʹÓÃ

    2016-03-24 11:00

ÍøÓѵãÆÀ
Ý