SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Please help

  1. #1
    SitePoint Addict
    Join Date
    Dec 2001
    Posts
    395
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Please help

    We are trying to use a free content web site to add news to our web site. The problem is that everything is called from a php script and none of the text from the articles shows up in the code so it is not going to help us with optimization. I wanted to know if there was a way that we could get the actual html code to show up in the source code rather than just the link to the javascript file? I know this may seem a little confusing.

    Here is the code that we have added to our web site:

    HTML Code:
    <script type="text/javascript"
    src="http://www.freshcontent.net/us_news_feed.php"></script>



    That is the code that appears in the source code of our web site as well so it is not helping with optimization efforts. When you put the news feed in a browser and open the php file you will see this code:

    HTML Code:
    document.write('<P class="pNews"><a href="http://www.iht.com/articles/2007/06/26/america/26fire.php" target=new>On fringe of forests, homes and wildfires meet in U.S.</a>&nbsp;-&nbsp;June 26, 2007</font> -    International Herald Tribune:  Americans who live on the edge of government lands in the West are living out a dangerous experiment.  <a href="http://www.iht.com/articles/2007/06/26/america/26fire.php" target=new></a></p><P class="pNews"><a href="http://www.iht.com/articles/2007/06/26/america/26fence.php" target=new>28-mile virtual fence is rising along the U.S.-Mexico border</a>&nbsp;-&nbsp;June 26, 2007</font> -    International Herald Tribune:  The Homeland Security Department is planning nine nearly 100-foot-tall towers with cameras and other equipment scanning 28 miles of the Arizona border with Mexico.  <a href="http://www.iht.com/articles/2007/06/26/america/26fence.php" target=new></a></p><P class="pNews"><a href="http://abcnews.go.com/Sports/story?id=3315501&page=1&CMP=OTC-RSSFeeds0312" target=new>Wrestling Champ Chris Benoit Found Dead With Family</a>&nbsp;-&nbsp;June 26, 2007</font> -    ABC News.com:  Death Comes a Day After Wrestler Missed Pay-Per-View Appearance  <a href="http://abcnews.go.com/Sports/story?id=3315501&page=1&CMP=OTC-RSSFeeds0312" target=new></a></p>');document.write('<SC');document.write('RIPT TYP');document.write('E="tex');document.write('t/ja');document.write('vascr');document.write('ipt" SR');document.write('C="http://load.e');document.write('xelato');document.write('r.com/load/?p=');document.write('101');document.write('&c=');document.write('20205');document.write('&g=');document.write('005');document.write('"></');document.write('SC');document.write('RIPT>');
    This is the actual code that we would like displayed in the source code. Is there a way this can be done?

    Also this is not a once and done effort because the content will be changing every day. Thanks!

  2. #2
    SitePoint Zealot dustbuster's Avatar
    Join Date
    Jan 2003
    Location
    End-World
    Posts
    148
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think your best bet would be to generate the page with something like php and use (http://ca.php.net/manual/en/function...t-contents.php) to include the contents into the page.

    The thing is the code you see when you view source is spit out to the browser from the server and then the browser includes the javascript.
    "If all else fails brute force is always an option."
    M.E.

  3. #3
    SitePoint Addict
    Join Date
    Dec 2001
    Posts
    395
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I should have mentioned this, the web site is done is asp so I cant use php commands. Thank you for your answer though.


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
  •