Welcome, Guest. Please login or register.
Did you miss your activation email?
May 24, 2012, 11:05:44 AM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
155449 Posts in 21704 Topics by 7731 Members
Latest Member: zvaigzdzius
* Home Help Search Login Register
Pages: 1 2 3 [4]   Go Down
Print
Author Topic: New Wrapper Hack!  (Read 18111 times)
Argos
Moderator
**
Offline Offline

Posts: 2156


WWW
« Reply #75 on: January 06, 2009, 12:36:18 PM »

You know what? It's even simpler than the current wrapper hack. No need for a module at all. Just put the AJAX code in the HEAD of the template, and put the following code in the WYSIWYG (or a code section) where you want the ajax content:

Code:
<script type="text/javascript">
ajaxinclude (rootdomain+"/the-path-to-your-content-file.html")
</script>

Of course you have to edit the path. So if your called content is the file thisfile.html in www.domain.com/my_includes/ the code would be:

Code:
<script type="text/javascript">
ajaxinclude (rootdomain+"/my_includes/thisfile.html")
</script>

There is no fallback for people without javascript though. Maybe some coder can create a solution for that? Or a combination with the wrapper hack, as a fallback measure?
« Last Edit: January 06, 2009, 12:39:02 PM by Argos » Logged

Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase: http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
Luckyluke

Offline Offline

Posts: 555



« Reply #76 on: January 08, 2009, 09:29:04 PM »

You know what? It's even simpler than the current wrapper hack. No need for a module at all. Just put the AJAX code in the HEAD of the template, and put the following code in the WYSIWYG (or a code section) where you want the ajax content:

Code:
<script type="text/javascript">
ajaxinclude (rootdomain+"/the-path-to-your-content-file.html")
</script>


Hi Jurgen,

And what if I don't want to put the code in the template?
Can I put all the code (ajax-code and the script) in a Code or Code2 snippet?
In Dynamicdrive they told to put the code in the Head section... the module Code/Code2 doesn't put the code in the head-section...
I'm sorry, I didn't test it.

Grtz,
Luc
Logged
Argos
Moderator
**
Offline Offline

Posts: 2156


WWW
« Reply #77 on: January 08, 2009, 10:09:39 PM »

I'm sorry Luc, I don't know if that will work, you'll have to try it yourself. But I guess it should be in the head, otherwise they would not have wriiten so. But'm not sure, I haven't tested it myself.

If it must be in the head, there are ways to let it load only when it's needed. I've seen that somewhere before (not here though). You'll have to google for it I'm afraid. Maybe there's even a way the other way round: to add it dynamically to the head only when it's needed.

But I'm no coder, so I cannot help you any further... I hope someone will find a clever way to come up with a handy solution.
Logged

Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase: http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
Luckyluke

Offline Offline

Posts: 555



« Reply #78 on: January 10, 2009, 11:54:39 AM »

Hi,

I just test this solution from Dynamic Drive and I have to say it works good. BUT... if there is a link inside the Iframe, the page inside the Iframe becomes full screen without the WB template.
In other words: if you have a SMF forum or something, if somebody clicks on an item, the forum pops fullscreen.
So, it's not good for me. It's no real wrapper  angry

Grtz,
Luc
Logged
Argos
Moderator
**
Offline Offline

Posts: 2156


WWW
« Reply #79 on: January 10, 2009, 02:29:12 PM »

I just test this solution from Dynamic Drive and I have to say it works good. BUT... if there is a link inside the Iframe, the page inside the Iframe becomes full screen without the WB template.
In other words: if you have a SMF forum or something, if somebody clicks on an item, the forum pops fullscreen.
So, it's not good for me. It's no real wrapper  angry

Maybe you can give this alternative a try: http://www.dynamicdrive.com/forums/showthread.php?t=28662
Logged

Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase: http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
Luckyluke

Offline Offline

Posts: 555



« Reply #80 on: January 22, 2009, 10:55:55 PM »

Maybe you can give this alternative a try: http://www.dynamicdrive.com/forums/showthread.php?t=28662

I don't have any idea how to implement this in WB.
I put the javascript in my template. So far so good.
And in the HTML section of Code2, I insert
<iframe name="mel" src="some.htm" width="100%" height="300" scrolling="auto" frameborder="1"></iframe>
as discribed... hmmm... height is 300 but must been variable...  huh

Grrrrrrrrtz,
Luc


Logged
Argos
Moderator
**
Offline Offline

Posts: 2156


WWW
« Reply #81 on: January 22, 2009, 11:00:44 PM »

Hi Luc, doesn't it work at all?
Logged

Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase: http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
Luckyluke

Offline Offline

Posts: 555



« Reply #82 on: January 22, 2009, 11:06:09 PM »

Hi Luc, doesn't it work at all?
Yeps, it shows in a iframe of 300 pixels height. Maybe I did something wrong. Maybe the javascript was'nt activated or I didn't write the code well in the Code2 module.
Because I hardcoded height="300" there was a chance it wouldn't work. Strange...
But, if you look at the bottom of this WB forum, it's also in a wrapper. How did Ryan this?

Luc
Logged
Pages: 1 2 3 [4]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!