Get PHP file using JavascriptJQuery - Stack Overflow

I need to use javascript or jquery to get a html or php file and put its contents inside a div of the c

I need to use javascript or jquery to get a html or php file and put its contents inside a div of the current page.

I know how to do this using ajax but would like to know if there is a simpler way without having to use all the code that ajax uses.

I need to use javascript or jquery to get a html or php file and put its contents inside a div of the current page.

I know how to do this using ajax but would like to know if there is a simpler way without having to use all the code that ajax uses.

Share Improve this question edited May 2, 2011 at 19:43 Mark Biek 151k54 gold badges159 silver badges201 bronze badges asked May 2, 2011 at 19:41 ChrisChris 1671 silver badge8 bronze badges 2
  • 2 What "all the code"? An AJAX call with jquery is all of one line of code with about 3 or 4 arguments chained together. – Marc B Commented May 2, 2011 at 19:43
  • 2 "How do I do AJAX without AJAX because one line of code is too long?" >.< – Lightness Races in Orbit Commented May 2, 2011 at 19:58
Add a ment  | 

2 Answers 2

Reset to default 8

I think you are looking for jQuery's $.load.

$('#div_id').load('url');

if <div id='mydiv'></div> is your target:

$('#mydiv').load('/address/to/page');

Should do the trick.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744890807a4599401.html

相关推荐

  • Get PHP file using JavascriptJQuery - Stack Overflow

    I need to use javascript or jquery to get a html or php file and put its contents inside a div of the c

    1天前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信