Results 1 to 8 of 8

Thread: include remote file into a variable

  1. #1
    Join Date
    Mar 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default include remote file into a variable

    Using script from DD: Cross Browser marquee II

    The line:

    var marqueecontent=' '

    ------------------------

    Question:

    How can I put a link there to include a file remotely, when I put any kind of include script there it shows the rest of the script below it on the page

    Thanks!

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I don't think there is a way to do that. You have at least two choices though:

    1) Write your content there, don't have an external file.

    2) Make the entire script an external file (you will still need to write your content in at that spot though).

  3. #3
    Join Date
    Mar 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    yeah but the problem is, its a parsed rss feed that needs to be included, and ofcourse its constantly updated so that won't work : (
    Last edited by formattedc; 03-27-2005 at 05:13 AM. Reason: typo

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Not familiar with that. Perhaps if you explain more, there could be a way. If the feed is suitable to be marquee content, how did it get that way, is it configurable via template or some other means? Can it be written to a file or referenced as a filename of your choosing?

  5. #5
    Join Date
    Aug 2004
    Location
    Brighton
    Posts
    1,563
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ooh, I know this one.

    Take out this line:

    var marqueecontent=' '

    And replace it with

    </script>
    <script src="marquee.js" type="text/javascript"></script>
    <script type="text/javascript">

    And then create a new file, marquee.js in the same folder with this in:

    var marqueecontent='Content Here'


    Please note this will NOT work if you have already got the marquee script running from external.

    cr3ative
    A retired member, drop me a line through my site if you'd like to find me!
    cr3ative media | read the stickies

  6. #6
    Join Date
    Jun 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by cr3ative
    Take out this line:

    var marqueecontent=' '

    And replace it with

    </script>
    <script src="marquee.js" type="text/javascript"></script>
    <script type="text/javascript">
    THis sounds like the answer to my problem however would the src="marquee.js" also be able to add to an absolute URL of src="http://www.domain.com/marquee.js" as well?

    The reason I ask is that i want to use the same source file on several sites using the script so i can display common files edited in a single place.

    Mark

  7. #7
    Join Date
    Aug 2004
    Location
    Brighton
    Posts
    1,563
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Yes, an absolute URL should be fine.

    cr3
    A retired member, drop me a line through my site if you'd like to find me!
    cr3ative media | read the stickies

  8. #8
    Join Date
    Oct 2005
    Posts
    121
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    if you wanna display the info from an external page, try using an iframe (inline frame)

    var marqueecontent="<iframe src='your file path' width='100%'>"

    with any other specs on the iframe that you want, then it should work, whether you are putting the script directly in the page or in an external file you can still have an external content source which could be dynamically updated (since I dont know php, I did something like this to create a forum with a form writing to a specified html file and displaying it in an iframe)

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
  •