tags:

views:

536

answers:

2

Hi Masters Of Web Development. I have a not that simple question this time. I have got a simple external HTML page, that I want to include in my site. The HTML page contains a submit form or something like that, and I wish to send this data from the form, without to reload the whole page. So I decided to put HTML page inside iframe. But, some people said that this is older technology, google doesn't like iframes, etc. So I want to use something like AJAX or JQuery to load that external HTML page, and to send submit form without reloading the whole page with it. :)

Any suggestions on how to make this? Thanks in advance :)

+1  A: 

You want to use the jQuery Forms Plugin. Its very straightforward and easy to turn any normal HTML form into an AJAX form.

Vincent Ramdhanie
Thanks but this plugin doesn't works in my case!
Spoonk
@Spoonk...what do you mean it does not work in your case? The iframe is fine as others have pointed out but if you want AJAX then this plugin is as easy as it gets.
Vincent Ramdhanie
@Vincent: We can't assume `Spoonk` is well equipped (in any way) to find integrating the plugin with ease. JQuery can be greek to a lot of people.
o.k.w
@Vincent: The problem is that the form is not simple form. It is a automatically generated playlist with songs from my WinAmp. So, If someone decides to request a song, clicks on it title, the whole HTML reloads and accepts the request. Well, that's why I need something similar to iframe - I don't want to reload whole site, but only the imported HTML file with that so called 'form' in it. And for that reason, I can't rewright the form to pass this plugin with it.Otherwise, my whole site is based on JQuery :)
Spoonk
+2  A: 

Do you really need Google to index that iframe form? If that's the only iframe you have throughout the site, it aint going to be a problem in terms of google indexing.

About using the Iframe, if you are not comfortable learning and building ajax-type form, you'll still be fine (like what Frankie commented). Just make sure the form works, usable and compatible with popular browsers.

o.k.w
Well no. I don't really need google to index that iframe. The exact words that I heard about iframe was "Google doesn't like iframes"...And finally I will use iframe... although I wanted something more web 2.0 you know :))
Spoonk
@Spoonk: I would encourage you to dig into stuff like jquery or other technologies. You might get hooked! :)
o.k.w
Well, my all site is based on JQuery and Ajax:)) I wanted something like iframe but based on AJAX or JQuery too. Something that will have a preloader until waiting my external HTML to load, and when I click "SEND" form. And stuffs like this, you know :))
Spoonk
Well, it that case, you can use Ajax loader (e.g. Jquery's `load` function, http://docs.jquery.com/Ajax/load) to load an external file into the page's container (e.g. a div).
o.k.w
@o.k.w: Thanks that you still reply to me :) I already use this to load my other external files to my pages. I can use it to load and this one too. The problem becomes when someone tries to send information trough that way included HTML file. It reloads whole site, not only the div where I loaded the external HTML file... :(( That's why I decided to use a iFrame :(( And if you wish, you can read my comment below @Vincent's post, right after yours. There I explain what kind of form I have got...
Spoonk
@Spoonk: You mentioned in your comemnt reply to Vincetn this `the whole HTML reloads and accepts the request`. Can't you 'submit' the form via ajax and get the reply to be loaded to the container via ajax too? It's kinda independent of the form's complexity, yea?
o.k.w
@o.k.w: Do you want to see what am I talking about?Go to http://spoonk.eu, and click on the second tab which title is "S!настроение". There you'll see how I implemented my "form" with iFrame. And I don't know how to submit form via AJAX as you sayd... :( The things are little bit complicated, and that's why I need something like iFrame, but with AJAX. Another reason to not want a Iframe is, that anyone can click with RMB and opens the external HTML file... I don't want this to happens :))
Spoonk