CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   JavaScript programming (http://www.codingforums.com/forumdisplay.php?f=2)
-   -   Updating a div with file (http://www.codingforums.com/showthread.php?t=273455)

sourabh1989 09-18-2012 12:24 PM

Updating a div with file
 
I want to insert a file into a div. my code is below.

Code:


<html>
  <head>
  <script src="table.js"></script>
  <link rel='stylesheet' type='text/css' href='table.css'>
 
  <script ="text/javascript">
  function help_file(value) {
   
    document.getElementById('help').location.href= value;
   
  }
  </script>

     
  </head>
  <body>
    <div class="toc">
    <h2>Existence Checks</h2>
    <ul>

      <li><a onclick="lib(FRS_existance_lib); help_file('../../../scripts_block/html/help_syntax.html');"><h3><u>Library Data</u></h3></a> </li>
   
    </ul>

    <h2>POK Checks</h2>
    <ul> 
      <li><a onclick="html_table(FRS_ccs); parent.help.location='help_pok_pm_cells_check.html';"><h3><u>CCS POK Cells Summary</u></h3></a></li>
      </ul>
  </div>
  <div id="help" class="help">HELP</div>
  <div id="content" class="content"></div>
  </body>
</html>

I have three div as in code. i want that when i click on the contents a file is opened in div with id "help"... Is it possible???

Can someone help me out???

devnull69 09-18-2012 03:31 PM

This is a typical AJAX task. Please take a look at the thousands of examples you will find on this forum as soon as you search.

Your example will not work. A DIV element does not have a location property.

sourabh1989 09-19-2012 04:56 AM

Quote:

Originally Posted by devnull69 (Post 1270956)
This is a typical AJAX task. Please take a look at the thousands of examples you will find on this forum as soon as you search.

Your example will not work. A DIV element does not have a location property.

I dont have any knowledge about ajax. Can this be achieved through javascript or anything else..?? Just provide me some reference what should i search for because i searched alot didn't got anything useful.

Any guidence or some short example you can provide will be very helpful

Philip M 09-19-2012 07:41 AM

I don't think you are trying. There is a whole sub-forum here devoted to Ajax and Design. As devnull69 says, "Please take a look at the thousands of examples you will find on this forum as soon as you search."

See also http://www.hunlock.com/blogs/AJAX_for_n00bs

sourabh1989 09-19-2012 09:40 AM

Quote:

Originally Posted by Philip M (Post 1271250)
I don't think you are trying. There is a whole sub-forum here devoted to Ajax and Design. As devnull69 says, "Please take a look at the thousands of examples you will find on this forum as soon as you search."

See also http://www.hunlock.com/blogs/AJAX_for_n00bs

Actually i was not getting what exactly should i search for but luckily i got my solution. Thanks guys for so much help.


All times are GMT +1. The time now is 10:52 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.