Results 1 to 3 of 3

Thread: Trick when two scripts do not work

  1. #1
    Join Date
    Jan 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Trick when two scripts do not work

    Hi

    Here is a trick you can use if two scripts on the same page do not work.

    However the trick only works if the script operates on a separate part of the page - i.e. a messagebox.

    Just create an iframe and put the script in this page. To get it to look nice you have to adjust the iframe so no scrollbars are shown.

    Regards

    Lars

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,878
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    If the forums are searched, you'll find many examples of this advice being given to people (although I wouldn't always agree, due to the necessity of involving iframes). However, it's not in the sticky, and I believe it needed to be said.

    Oh: don't forget to remove the border, too.
    Code:
    <iframe style="border-style:none;overflow:hidden;" src="myscript.html"/>
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,076
    Thanks
    44
    Thanked 3,216 Times in 3,178 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by Twey
    Oh: don't forget to remove the border, too.
    Code:
    <iframe style="border-style:none;overflow:hidden;" src="myscript.html"/>
    That doesn't remove the border in IE which also requires the old style of tag closure for this tag, for that you need:

    HTML Code:
    <iframe frameborder="0" src="myscript.html"></iframe>
    Overflow for the external page is controlled by its body's style, or you can use the scrolling="no" attribute for the iframe tag. Other refinements are often necessary to get the x-browser 'look and feel' one is after using this method. It still can be far easier than rewriting scripts, unless the problem is only a simple onload event conflict.
    - 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
  •