Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 9 of 9
  1. #1
    Junior Member
    Join Date
    Jun 2007
    Posts
    3
    Member #
    15340
    Ok, i'm developing an e-commerce website. it has multiple categories, and each category loads a search option in an iframe. the iframe consists of 2 things, the category's image(pet supplies, clothes, funiture, etc) and a search bar that loads the searched keyword in another iframe within the iframe!

    So... i have a vortex of iframes going on. Now... as some of you might know, you can adjust the width of an iframe to 100%, but not the height... so i had to find a javascript to allow the iframe to adjust the height to 100% of the content within it. the code works just fine... for the first iframe (the iframe that loads nothing but the category image and the search bar form), but when i load the iframe within the iframe, the height adjustments do not take place unless i manually press the "refresh" button on my internet explorer, firefox, avant, opera, etc...

    just to clear up any possible future misunderstandings, when i search for a keyword, it triggers a javascript with an external source, so needless to say, some time needs to go by before I manually refresh the browser. I've already used java codes such as
    self.parent.location.href = self.parent.location.href

    the problem with these scripts is that they reload everything, including the original state of the iframe src="", which is blank! i just need to refresh everything, as in... i need the iframe src="" to stay the same when i refresh iframe1...

    see, i know i don't really have to refresh the whole page to get iframe1 to readjust it's height, i just need to refresh iframe1 AFTER iframe2 has loaded the external java source... but as I said, the external javasource takes some time to load for some reason, even with a bandwidth connection.

    If anyone can help me out with this, I would greatly appreciate it. Prefferably, I would like to refresh iframe1 only to resize it's height to 100%, but if there is a simple little command that will just refresh all content, while keeping the src="" for iframe1 and iframe2... then that would be fine too!

    i would appreciate any help regarding these issues...

    thank you,
    -dan

  2.  

  3. #2
    Senior Member Steax's Avatar
    Join Date
    Dec 2006
    Location
    Bandung, Indonesia
    Posts
    1,207
    Member #
    14572
    java? You mean javascript. Don't mix them up!

    I have to say that for this case, AJAX is a much better option. You don't need to be worried of iframe problems and can layout things using CSS like normal.
    Note on code: If I give code, please note that it is simply sample code to demonstrate an effect. It is not meant to be used as-is; that is the programmer's job. I am not responsible to give you support or be held liable for anything that happens when using my code.

  4. #3
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Yeah, you're going to be wanting to use AJAX for what it sounds like you're trying to do. Either that or plain old HTML with some server-side includes so you make multiple pages thta have the same surrounding content but without rewriting the content every time.

  5. #4
    Junior Member
    Join Date
    Jun 2007
    Posts
    3
    Member #
    15340
    so, what ur tell'n me is that i have to teach myself a whole new language to solve this problem? there's no way i can just simply type in a command, and have the page refresh, just like it would if i manually went to the top and pressed it down? i can't just tell the internet explorer my visitors are using to refresh after the external java source has been querried/loaded? and btw... what is the difference between java and javascript? because if there is a major difference, i think it's javascript i'm talking about, not java... please, i'm confused, need help, lol!

  6. #5
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Yep, you'll need a new language (assuming we're talking about Javascript). HTML and HTTP are, by default, simply one page, the same page, sent to your computer, every time. You layer on Javascript on the client to give that page new behavior. You layer on PHP on the server to allow one page to take multiple forms and to grab data and to, in general, be more dynamic and more reactive to what the user wants.

    Browsers are dumb. They just display whatever you tell them to. Using Javascript, they can manipulate what is being displayed.

    And yes, you mean javascript. Java is a language that's typically used server-side (rather than client-side as with Javascript). It's `fully' object-oriented, the classical way, and had a syntax only vaguely similar with that of Javascript. Javascript runs client-side, is object-oriented based on prototypes, and has dynamic typing, anonymous functions, closures, and other things that aren't in Java at all.

  7. #6
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,717
    Member #
    5580
    Liked
    718 times
    Dan,

    Can you give us a link to what you have so far?
    I can't visualize this without seeing it.


  8. #7
    Senior Member Steax's Avatar
    Join Date
    Dec 2006
    Location
    Bandung, Indonesia
    Posts
    1,207
    Member #
    14572
    Don't panic about learning a new language - you said you've already got some JS code! And there are many JS libraries to make your life easier in implementing this AJAX stuff, I'm sure you'll get it in no time.
    Note on code: If I give code, please note that it is simply sample code to demonstrate an effect. It is not meant to be used as-is; that is the programmer's job. I am not responsible to give you support or be held liable for anything that happens when using my code.

  9. #8
    Junior Member
    Join Date
    Jun 2007
    Posts
    3
    Member #
    15340
    http://www.outhouseprices.com

    i've already worked aroung the problem by using only one dimension of iframes, removing the iframe within the iframe all together. i'm just getting anxious to launch my public relations campaign soon, and i need a quick fix... i would much rather have the iframe within the iframe, but what i have for now will do... for now.

    Umm, if you want to see the problem in action, i'll make the Video Games category use the method i am aiming for, while the rest are set to the "quick fix".

    to see what i'm talking about perfectly clear, just go to the "Video Games" category, then type in nintendo in the search bar, hit enter, and wait for it to load

    after you see the bottom part of the page become visible, refresh your browser and you'll see the javascript readjust the height to meet 100% of the content within it. the searched keyword appears in iframe2, and the readjustments take place around iframe1 (iframe2 is within iframe1)

  10. #9
    Senior Member Steax's Avatar
    Join Date
    Dec 2006
    Location
    Bandung, Indonesia
    Posts
    1,207
    Member #
    14572
    Here's what I'd do:

    1. Replace the current layout to a more effective left-bar-navigation layout. And with CSS too.
    2. Get a javascript library (mine being jQuery), install it.
    3. Hookup the navigation buttons to events that load new pages into the main area.
    4. Set up the "search" button to submit the search and load it into the main area.
    5. Have lunch and enjoy.

    Just my steps if I'm handling your problem.
    Note on code: If I give code, please note that it is simply sample code to demonstrate an effect. It is not meant to be used as-is; that is the programmer's job. I am not responsible to give you support or be held liable for anything that happens when using my code.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 02:56 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com