Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loop during load remote template (with local xampp server) #15

Closed
pwFoo opened this issue May 17, 2019 · 3 comments
Closed

Loop during load remote template (with local xampp server) #15

pwFoo opened this issue May 17, 2019 · 3 comments
Assignees

Comments

@pwFoo
Copy link

pwFoo commented May 17, 2019

Is it a bug or a problem with 127.0.0.1 as server?
Template is loaded in an endless loop instead of once.

image

@anywhichway
Copy link
Owner

anywhichway commented May 17, 2019 via email

@pwFoo
Copy link
Author

pwFoo commented May 17, 2019

<html lang="en">
<head>
	<!--<script src="https://unpkg.com/tlx/browser/tlx.min.js"></script>-->
	<script src="https://unpkg.com/tlx@1.0.39/browser/tlx.min.js"></script>
	<style>
	input:invalid {
  		box-shadow: 0 0 5px 1px red;
	}
	</style>
</head>
<body>
<div>
You must be loading this file over an http server for this example to work
</div>
<div id="message"></div>
<hr />
<div id="name">First Name: <input id="firstName" name="firstname" value="${firstname}" protect placeholder="Enter a name"></div>
<hr />
<div>Below there should be a message that a load has failed.</div>
<div id="fail"></div>
<script>

const model = tlx.reactor({firstname:"joe"}),
		url = new URL("./template.html",window.location.href),
	missing = new URL("./missing.html",window.location.href);

tlx.view(document.getElementById("message"),{model,template:url.href});
tlx.view(document.getElementById("name"),{model,linkModel:true});
tlx.view(document.getElementById("fail"),{model,template:missing.href});
</script>
</body>
</html>

Output:
image

@anywhichway
Copy link
Owner

@pwFoo This has been fixed. Sorry for the inconvenience of the bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants