Make paths work correctly with .load into div.

Make paths work correctly with .load into div.

Hi, I'm back again! This time, latest jquery versions I promise. ^^
I'm currently trying to use the phpbb forum of my website as a sort of "comments" section on my webpages, and after mulling it over for a long time I've decided to not use an iframe and try to do to this with jquery (since I'm already using it now anyway). However when I pull the forum topic page into a div with .load, all the paths get broken.

For example, website is site.com   and forum is at   site.com/forum

and when I load the page into a div with (along with about about 100 .remove functions for styling)

  1. $('#test').load('./forum/viewtopic.php?f=13&t=10', function(result) {
  2.     var variable = $('#result').html();

All the links are broken, and I think it causes "everything to break". All of the "submit post" buttons now point to, again just as an example, site.com/submitpost.php   instead of    site.com/forum/submitpost.php, the same thing also happens to all the relevant scripts that get called, and so what should be an ajax-responsive page, seems to just become 'useless'... I really hope this makes sense if not I'll try to be clearer.

Is there a solution to this exact problem? A lot of googling showed me that it's common for image paths to become broken with .load, but I couldn't seem to find much of a solution. Is an iFrame the only answer to this exact problem?

Thank you for your time.



Edit: Alternatively (forgive me if this is too off-topic now), is there a way to "rewire" the 'semi-useless' post submit button I currently have? If I could 'rewire' the button to, just as an example, still send the post from the form and redirect back the page user was just on, this would be a perfectly fine solution for my current needs.