Skip to content
Loading
 
+2
  • +2
    Hello,
     
    You can use jquery.May following code help you.
    1. "jquery.js">  
    2.   
    +2
  • +1
    I followed your instructions but nothing is running? here is my code:
    Your Way Sachin Singh
    [CODE] 
    Example load html in main page
    $("#homeNav").click(function(){
    $("#GreenArea").load(home.html);
    });
    ...
    [/CODE]
     
     
    Your Way Ajay Gohil
    [CODE]  
    Example load html in main page
    ...
    [/CODE]
     
     
    Your Way Jignesh Kumar
    [CODE]  
    Example load html in main page
    ...
     [/CODE]
    +1
  • +1
    Hello Sachin Singh!
    I use Sublime Text 3 to design the interface of the program, if the program runs well I will switch to asp.net. I ran your code, it didn't load in the green area, I see the words Load ... in the menu area, you see the results of my image https://www.mediafire.com/view/4efa8sxj64fysyh/DesignLoadItemWebEn2.jpg/file
    +1
  • Sachin Singh
    +1
    there is no chance that it will not work
    your url must be using either file:// or C:/,
    which causes origin policy error, if your html have a url like http://html1.html and http://html2.html then it will work for sure.
    please check your browser console for errors , i am sure you are getting policy errors.
    +1
  • +1
    I checked my browser, everything normal
    +1
  • Ashutosh Gupta
    +1
    $("divId").click(function (e) {
    e.preventDefault();
    $("#GreenArea").load("g.html");
    +1
  • Sachin Singh
    0
    1.     "container">    
    2.     "menu">    
    3.     "nav justify-content-center">    
    4.     "nav-item">"nav-link" href="Home.html" id="homeNav">Home
    5.     
    6.     "nav-item">"nav-link" href="#">ServiceForum
    7.     
    8.     "nav-item">"nav-link" href="#">Question
    9.     
    10.     "nav-item">"nav-link" href="#">Forum
    11.     
    12.     "nav-item">"nav-link" href="#">Contac
    13.     
    14.      
    15. GreenArea">
       
    16.     
        
  •         
  •   
  • $("#homeNav").click(function(){  
  •   
  • $("#GreenArea").load(home.html);  
  •   
  •   
  •   
  • }); 
  • 0
  • Sachin Singh
    0
    it is working fine in my case, please check browser (inspect and watch console errors) , you might be getting cors policy error
    1.   
    2.   
    3. Example load html in main page  
    4. "utf-8">  
    5. "viewport" content="width=device-width, initial-scale=1">  
    6. "stylesheet" href="bootstrap453/css/bootstrap.min.css">  
    7. "stylesheet" type="text/css" href="css/style07.css">  
    8. "https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js">  
    9. "https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js">  
    10. "bootstrap453/js/bootstrap.min.js">  
    11.   
    12.   
    13. class="container">  
    14. "menu">  
    15. class="nav justify-content-center">  
    16. class="nav-item">class="nav-link" href="#" id="homeNav">Home
    17.   
    18. class="nav-item">class="nav-link" href="#">ServiceForum
    19.   
    20. class="nav-item">class="nav-link" href="#">Question
    21.   
    22. class="nav-item">class="nav-link" href="#">Forum
    23.   
    24. class="nav-item">class="nav-link" href="#">Contac
    25.   
    26.   
    27.     

      Load...

        
    28. "GreenArea">
      
  •   
  •   
  •   
  •   
  •   
  •  
    0