Can I make an XMLHttpRequest to another domain?

后端 未结 7 1516
面向向阳花
面向向阳花 2021-02-18 18:29

Is there a way to use XMLHttpRequest in combination with other domains?

I would like to parse some xml from Google without having to use a server so it is minimalistical

7条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-18 18:40

    It's a security issue, most (all?) browsers won't let you do that. You can use a hidden IFrame to do your fetching, but it's complex enough that i'd just use a server (or switch to a different language, if i don't have to run in a browser)

提交回复
热议问题