Sunday 15 May 2011

jquery - load php files as templates into div upon page load -


I am trying to create a single page-application. On loading the index page, I want to load two php templates in my respective divs. One of the templates is a login form, and the other is the registration form I am reading from - It seems I need to request "get" an AJAX to do this (as I load two files (jquery) Can not do on the function). Here's what I have:

application.js

  $ (document) .ready (function () {$ .ajax ({type: "GET", url: "Templates / loginform.php", data: somedata, success: function (somedata) {$ ('# login'). Append (somedata);}}) $ $ AJAX ({type: "GET", url: " Template / regfire.fpp ", data: amgata, success: function (amigata) {$ ('# register'). Append ();}});});   

Everything I find is an empty page.

Solution: $ ('Template / regform.php', function (data) {$ ('# register'). Append (data);});

No comments:

Post a Comment