从另一个文件中获取数据? 没有jQuery或Ajax?

How would I get data from another file. For example a username check:

$.ajax({ 
    type: "POST", 
    url: "check.php", 
    data: "username="+ usr, 
    success: function(msg){ }
)}

That example uses ajax, I was wondering how I would do something similar, without any javascript plugin/extension.

IMHO,not possible.

 $("#randomdiv").load("load.php")

You cannot do that without JavaScript.

What you can use is:

  • simple XHR request
  • iframe

If you want to get the file over HTTP, then no — that is, by definition, Ajax.

If you are happy getting the file from the user via a <input type="file"> then you can use the File API.

If, by Ajax, you actually mean "jQuery's ajax method", then you can do it directly using XMLHttpRequest.