Welcome to Geeklog, Anonymous Saturday, April 20 2024 @ 10:26 am EDT

Geeklog Forums

DHTML on static pages


spock

Anonymous
Hey guys,

I tried to add an API slideshow to a static page on my geeklog page. I linked the stylesheet and javascript and made all the changes in the header and static page, but the program still does not display properly. My guess is there is a calling conflict due to the rendered nature of the static pages. I can't think any other reason, and I haven't had much time to examine the code of the program, but assuming that it's robustly written and works properly on non-Geeklog site, which is true, is there a reason for me to think that DHTML programs called from a static page do not render correctly? Or is there a special trick to embedding them?

FYI: I am using Geeklog version 1.4.0.sr2. And here is the link to the page where I use the API: ">click here.

THANKS!
 Quote

Status: offline

beewee

Forum User
Full Member
Registered: 08/05/03
Posts: 969
Location:The Netherlands, where else?
Stories and Static Pages filter some HTML elements for security reasons. If you use the WYSIWYG editor that will change your DHTML even more. Did you try it with a disabled (config.php setting) Advanced Editor?

Dutch Geeklog sites about camping/hiking:
www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512
try not using relative urls, i.e., ensure you are using absolute urls.
 Quote

spock

Anonymous
Quote by beewee: Stories and Static Pages filter some HTML elements for security reasons. If you use the WYSIWYG editor that will change your DHTML even more. Did you try it with a disabled (config.php setting) Advanced Editor?


I haven't but for reference I am including below the code I used, so you can tell me what you make of it. Does it have any portions that might be filtered? I'm thinking SCRIPT tag, perhaps.

Text Formatted Code
<div id="imageSlideshowHolder">
        <img src="http://streetvendor.org/pictures/1.jpg">     
        <img src="http://streetvendor.org/pictures/10.jpg">
        <img src="http://streetvendor.org/pictures/11.jpg">
        <img src="http://streetvendor.org/pictures/12.jpg">
        <img src="http://streetvendor.org/pictures/13.jpg">
        <img src="http://streetvendor.org/pictures/14.jpg">
        <img src="http://streetvendor.org/pictures/15.jpg">
</div>

<p>Normal web content
<SCRIPT type="text/javascript">
initImageGallery();
</SCRIPT>
 


 Quote

spock

Anonymous
Quote by machinari: try not using relative urls, i.e., ensure you are using absolute urls.


Totally. That was the first thing I checked, but that's not what's causing it. I'm leaning towards beewee's explanation, although it might be something we haven't thought about before
 Quote

spock

Anonymous
Quote by beewee: Stories and Static Pages filter some HTML elements for security reasons. If you use the WYSIWYG editor that will change your DHTML even more. Did you try it with a disabled (config.php setting) Advanced Editor?


I think you are right about Advanced Editor. I looked through the config.php file and didn't find the SCRIPT tage anywhere on the list. Could you help me add it in? The code seems to assign array values to the tags, and I don't understand how to pair them with the SCRIPT tag at all.

Here is the code from config.php:

Text Formatted Code
/* This is a list of HTML tags that Admins (site admin and story admins) can
 * use in their posts. It will be merged with the above list of user-allowable
 * tags ($_CONF['user_html']). You can also add tags that have already been
 * listed for the user-allowed HTML, so as to allow admins to use more
 * attributes (see 'p' for an example).
 */
$_CONF['admin_html'] = array (
    'p'     => array('class' => 1, 'id' => 1, 'align' => 1),
    'div'   => array('class' => 1, 'id' => 1),
    'span'  => array('class' => 1, 'id' => 1),
    'table' => array('class' => 1, 'id' => 1, 'width' => 1, 'border' => 1,
                     'cellspacing' => 1, 'cellpadding' => 1),
    'tr'    => array('class' => 1, 'id' => 1, 'align' => 1, 'valign' => 1),
    'th'    => array('class' => 1, 'id' => 1, 'align' => 1, 'valign' => 1,
                     'colspan' => 1, 'rowspan' => 1),
    'td'    => array('class' => 1, 'id' => 1, 'align' => 1, 'valign' => 1,
                     'colspan' => 1, 'rowspan' => 1)
);
 
 Quote

Status: offline

jmucchiello

Forum User
Full Member
Registered: 08/29/05
Posts: 985
The second array is just a list of keys. The dummy values of '1' are just there to make the array put the attribute in the key. So the two lines below should be sufficient. Don't forget the comma on the 'td' line.
Text Formatted Code

    'td'    => array('class' => 1, 'id' => 1, 'align' => 1, 'valign' => 1,
                     'colspan' => 1, 'rowspan' => 1),
    'script' => array('type' => 1),
    'noscript' => array()

 

Joe
 Quote

spock

Anonymous
Quote by jmucchiello: The second array is just a list of keys. The dummy values of '1' are just there to make the array put the attribute in the key. So the two lines below should be sufficient. Don't forget the comma on the 'td' line.
Text Formatted Code
<br />    'td'    => array('class' => 1, 'id' => 1, 'align' => 1, 'valign' => 1,<br />                     'colspan' => 1, 'rowspan' => 1),<br />    'script' => array('type' => 1),<br />    'noscript' => array()<br /><br />

Joe



I made all those changes to the code but there is still something wrong with the display. Instead of showing a slide show of images it simply outputs the images which are buried inside the "hidden" tag. This is really weird.
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512
have you tried an absolute url so that your script can be found? I'm not talking about an absolute url for the images, but for loading the script itself.

because you are expecting the script to run from a staticpage, I wouldn't expect a relative url loaded in the head tag to work. Just my two cents
 Quote

All times are EDT. The time is now 10:26 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content