dcsimg
A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: Embed a Webpage

  1. #1
    Musical chair sumwungye's Avatar
    Join Date
    Jan 2008
    Location
    Planet Earth, third planet from the Sun
    Posts
    287

    Embed a Webpage

    Hey all

    This is a pretty simple concept (poorly explained), but I don't know if it's possible to do.

    Can I have one webpage embed another webpage within? The catch is, when I go to view source, can it only show the first webpage's source, and not the embedded page's source?

    Basically, it would look like the second page, but the source would be of the first page (but would directly link to the second page with the embed).

    Hopefully not too confusing..

    Thanks!
    --SumWunGye

  2. #2
    Senior Member
    Join Date
    Apr 2002
    Posts
    2,849
    Well you can embed a page within a page using an iframe tag, and viewing the source of the parent page would only show the iframe tag, not the source of the iframe itself. However it's easy enough to see the source of the iframe, depending on the browser.

    You're going to have a hard time hiding the source, as it's built into every browser and fundamental to the way the web works. So the better question would be, what are you trying to accomplish that you feel you need to hide the source?

  3. #3
    Musical chair sumwungye's Avatar
    Join Date
    Jan 2008
    Location
    Planet Earth, third planet from the Sun
    Posts
    287
    Hi Rdoyle720, thanks for the reply

    An iframe is the same kind of idea of what I want, except by right-clicking inside of the area and viewing the source, it will show that embedded page's source. A way to cover the iframe with an invisible layer of the parent page would be a solution to this, but if possible, i'd like to let the viewer still interact with the content within.

    It's not so much hiding the source, but a way to only show the source of the host page. The source of the inner page would be findable; the host page would link directly to it. I want to implement this, so it'd be easier to separate different parts of code, and to emphasize the host code while focusing less on the code inside the iframe.

    Is it possible?

    thanks!
    --SumWunGye

  4. #4
    Senior Member joshstrike's Avatar
    Join Date
    Jan 2001
    Location
    Alhama de Granada, España
    Posts
    1,131
    It's not possible to cover one frame with something from another. That would defeat the whole purpose of frames.
    Also, the source will always be there, because that's what the browser is reading.
    Your only option would be to image the page you're trying to show as a JPG and display that. But then it wouldn't be interactive.

  5. #5
    Musical chair sumwungye's Avatar
    Join Date
    Jan 2008
    Location
    Planet Earth, third planet from the Sun
    Posts
    287
    Hi Joshstrike,

    How would that defeat the purpose of frames? I've heard about a CSS z-axis value which can put content in front of content, but I don't know how well it would be able to make the source code unreachable without having to go directly to the page inside of the frame.

    Something else I just found a few hours ago is code which can import JavaScript content, like so:

    Code:
    <SCRIPT LANGUAGE="JavaScript" SRC="filename">
    </SCRIPT>
    I may end up using this, but I'll have to test it out and see how it works with my ideas.

    Thanks!
    --SumWunGye

  6. #6
    Senior Member
    Join Date
    Apr 2002
    Posts
    2,849
    I still don't understand your reasoning. You're trying to remove the source for yourself, or for the viewers of the site? What does "emphasize the host code while focusing less on the code inside the iframe" mean? Who exactly is going to be focusing on it? If you're talking about your site viewers (which you seem to be, given your desire to allow someone to see the source), I don't know why anyone would care enough to check the source code of your site.

    Inserting content via Javascript will make it invisible to Google and is still accessible to users, depending on the browser.

  7. #7
    Musical chair sumwungye's Avatar
    Join Date
    Jan 2008
    Location
    Planet Earth, third planet from the Sun
    Posts
    287
    I'm trying to hide the source for anyone viewing the page, but if they go straight to the source file, then it will be visible. (Well, not in the end, but right now, that's the plan.)

    Where I said I wanted to "emphasize the host code", I meant hide the iFrame code, while the host code is still visible.

    And I didn't think about that, hmm.. Browsers which can see the source of the embedded script will pretty much kill that idea..

    If there's such a thing as server-side JavaScript, that looks like it may be the only way right now...I feel like I've heard it's possible with some servers, but I'm not sure..

    Thanks!
    --SumWunGye

  8. #8
    Senior Member
    Join Date
    Apr 2002
    Posts
    2,849
    "I'm trying to hide the source for anyone viewing the page, but if they go straight to the source file, then it will be visible."

    WHY??? Security? Something else? If you explain what you're trying to accomplish rather than simply that you're trying to hide it, you might get some better advice from us.

    Hiding source code is not going to happen. You can make it harder to find, but the browser has to see the source code to render the page, which means the source code has to be sent to the user's computer. Which means they will be able to access it, one way or another.

  9. #9
    Senior Member joshstrike's Avatar
    Join Date
    Jan 2001
    Location
    Alhama de Granada, España
    Posts
    1,131
    Yeah. Why???

    You do understand that browsers need to see the source in order to show the source to the user. Unless you just want to take a screenshot of it and display it as a jpg, the source has to get to the browser. And anything the browser sees, the user can also see. As unjust as this seems, there are no exceptions to it, and we all show our source to the world daily, who do front-end work.

    So whose work are you trying to steal, and what's the point of all this?
    The Strike Agency
    http://www.theStrikeAgency.com

    StrikeSapphire -- The Original Bitcoin Casino
    https://strikesapphire.com
    (not available in the US)

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center