Results 1 to 8 of 8

Thread: Glossy Accordion Menu & Javascript Problem

  1. #1
    Join Date
    Jan 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Glossy Accordion Menu & Javascript Problem

    1) Script Title: Glossy Accordion Menu

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...enu-glossy.htm

    3) Describe problem:
    If I include asp or html file into the iframe, can javascript in this included asp/html execute? Without opening a new page, and only execute the data in the iframe, white the glossy menu still exist on the left hand side?
    How do I make it executable?

    Should I put the javascript inside the included asp which is pulled into the iframe? or Should I put the javascript in the same file where the glossy menu placed?



    Last edited by 1019; 01-08-2009 at 06:28 PM.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,167
    Thanks
    44
    Thanked 3,240 Times in 3,201 Posts
    Blog Entries
    12

    Default

    What do you mean by include? The purpose of an iframe is to remove any need for includes. Pages may be directly loaded into it. Once there, they will in almost all respects act just like the page loaded directly into the browser.

    Even if the page loaded into the iframe has includes on it, if it all worked as a separate page, it should all still work in the iframe.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jan 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi John,

    Sorry, let me revised the question.

    There is javascript in (4).asp, and it works fine when seeing (4).asp link directly.

    While in (1).asp, and clicking (2) menu, the (4).asp will be pulled into (3) iframe. However, javascript in (4).asp doesn't work at this situation while it's pulled in to (3) iframe in (1).asp file.

    Is there a specific way to make the javascript works under this situation? I meant the javascript in (4).asp does work while it's independent link.

    Last edited by 1019; 01-09-2009 at 11:02 PM.

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,167
    Thanks
    44
    Thanked 3,240 Times in 3,201 Posts
    Blog Entries
    12

    Default

    How are you 'pulling in' to (1)? If you are using AJAX, it's usually quite complicated. Scripts and stylesheets on the imported page will usually not work and will need to be imported as well as (in the case of scripts) often initialized, or modified to require no new initialization with new content.

    If it's an asp include, just launch the page (1) with the include on it in a separate tab or window. View its served source (browser's view menu > view source), make sure all of the paths on it and in it's resource files are correct for its location on the server.

    Even with AJAX importation, the paths must still be valid for the page the new imported content is on.

    So there are really two issues. Once you bring new content to a page, that imported content's paths must be valid on the page it is being imported to.

    If this is an AJAX import, other issue dealing with scripts and styles will quite possibly exist.

    The iframe is a red herring, what works in a separate window should work in it.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Jan 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi John,

    I'm not sure what you meant by "How are you 'pulling in' to (1)".
    I got this sources from here
    On the bottom, there is "Glossy Accordion Menu with responsive headers", I like the way when clicking BLUE Menu- "CSS Examples" or "CSS Drive", an external link is loaded into the iframe on the right.

    I would like to do the same, make (4).asp loaded into the iframe, but also make javascript in (4).asp works fine under this situation. NOTE: (4).asp works fine independently

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,167
    Thanks
    44
    Thanked 3,240 Times in 3,201 Posts
    Blog Entries
    12

    Default

    Sorry, your poor spelling threw me off:

    "pulled in to (3) iframe ni (1).asp file."

    But I think I have it now. If 3 really is an iframe, there should be no problem. In fact, the example you represent in your image from Dynamic Drive does just that. When external pages are loaded into the iframe, their scripts work just fine.

    There could be so many reasons why you are having a problem with this, but I'm almost 100% sure that none of them have to do with iframe.

    To diagnose your problem(s), we would need a link to a page on your site that demonstrates the problematic pages in action.

    Be sure to mention what we need to do to replicate the problem.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Jan 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    sorry for the typo.

    At this point, I think the problem I have is more about combining it with Ajax. Like execute JavaScript function after AJAX loaded problem...


    Another question, the example shows on dynamicdrive enables users to load external file into the iframe, but only through the Header. Is there a way to make it work as well under the sub-menu <ul><li>?

  8. #8
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,167
    Thanks
    44
    Thanked 3,240 Times in 3,201 Posts
    Blog Entries
    12

    Default

    Please post a link to the page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •