Freemarker .load() jquery

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Freemarker .load() jquery

tgarijo
Hello

This is the scenario
I have page name a.ftl, it has  a div id="capa", this page has a jquery $("#capa").load('/b.ftl');
In b.ftl there is a freemarker form, but when run $("#capa").load('/b.ftl') not played.

I attach


Reply | Threaded
Open this post in threaded view
|

Re: Freemarker .load() jquery

Daniel Dekany
FreeMarker runs on the server, generates the page, and then the client
(the browser) receives that already generate page, and executes the
JavaScript. Thus, FreeMarker has nothing to do with jQurey. Your
browsers runs whatever you see with Ctrl+U (source view).


Thursday, November 12, 2015, 6:46:48 PM, tgarijo wrote:

> Hello
>
> This is the scenario
> I have page name a.ftl, it has  a div id="capa", this page has a jquery
> $("#capa").load('/b.ftl');
> In b.ftl there is a freemarker form, but when run $("#capa").load('/b.ftl')
> not played.
>
> I attach
>
> <http://freemarker.624813.n4.nabble.com/file/n4655597/freemarker.png>
>
>
>
>
> --
> View this message in context:
> http://freemarker.624813.n4.nabble.com/Freemarker-load-jquery-tp4655597.html
> Sent from the freemarker-user mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> _______________________________________________
> FreeMarker-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/freemarker-user
>

--
Thanks,
 Daniel Dekany


------------------------------------------------------------------------------
_______________________________________________
FreeMarker-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-user
Reply | Threaded
Open this post in threaded view
|

Re: Freemarker .load() jquery

tgarijo
Thank You Daniel

I post the code

<html>
<head>
    <title>Sign On</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" >    
  	<meta charset="utf-8">  	
  	<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"/>
  	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
  	
  	<script>
		$(document).ready(function(){	   	
		   $("#ocultar").click(function(event){
		    	event.preventDefault();
		    	$("#capa").hide("slow");
		    	window.location.href = "/spiede/pages/jsp/login/login.jsp";
		   });
		   $("#mostrar").click(function(event){
		   		$("#capa").empty();
	    		event.preventDefault();
	    				 
				$("#capa").load('/spiede/pages/freemarker/search/invoceSearch.ftl');
			    $("#capa").show(200);	    
    	    										
	   		});
		});		
	</script>

</head>

	<body>
		<nav class="navbar navbar-default">
		  <div class="container-fluid">
		    <div class="navbar-header">
		      <a class="navbar-brand" href="#">Options</a>
		    </div>
		    <div>
		      <ul class="nav navbar-nav">
		        <li id="ocultar" class="active"><a href="http://localhost:8080/spiede/pages/jsp/login/login.jsp">Home</a></li>
		        <li><a href="#" id="mostrar" >Invoice</a></li>	        
		      </ul>
		    </div>
		  </div>
		</nav>
		<div class="panel panel-success">
		  
		    <div class='alert alert-info fade in' data-alert='alert'>	  	  	
			</div>   
	
	    	<div class="container-fluid">                    		         
			    <div id="capa" class="container"  style="display: none"></div>                        
	         </div>
	    </div>
	</body>
</html>


<html>
<head>
    <title>Sign On</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" >    
  	<meta charset="utf-8">
  	<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
  	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>  	  
</head>

<body>

	<@s.form action="add" method="post">
        <@s.textfield label="First name" name="user.firstname"/>
        <@s.textfield label="Last name" name="user.lastname"/>
        <@s.submit value="Save"/>
    </@s.form>

</body>
</html>