www.webdeveloper.com
Results 1 to 5 of 5

Thread: include file using innerHTML

  1. #1
    Join Date
    Feb 2012
    Posts
    8

    include file using innerHTML

    Hi,

    Wanted to include ASP file in a div when a certain condition is passed in a javascript function using the innerHTML property.

    Tried using the following but not working.

    document.getElementById("frame").innerHTML="<!--#include file="/include/show.asp"-->"

    Please suggest...

  2. #2
    Join Date
    Mar 2009
    Posts
    452
    FYI ASP is a server side language and run on server side. while JavaScript runs on client side.

    why dont you try AJAX ?

  3. #3
    Join Date
    Feb 2012
    Posts
    8
    Thanks ZABI

    I tried including a HTML page. No change...

    DOM elements are supported with JavaScript and AJAX is an extension of the same. Correct me if I'm wrong

  4. #4
    Join Date
    Mar 2009
    Posts
    452
    AJAX = Asynchronous JavaScript and XML

  5. #5
    Join Date
    Mar 2012
    Location
    Saint-Petersburg, Russia
    Posts
    97
    ZABI means that you need to use ajax call in javascript which fetches text to be inserted from the server and when it is returned, you can place it into inner html. ASP scripts will not do since they are executed before browser gets the page and you could do with them nothing after page is loaded into browser (while javascript on contrary is working after loading).

    Google for "ajax tutorial" and you in a few minutes will know what is it all about. Not too complicated trick, however.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles