nhanfu / htmljs

HTML render engine and data binding (MVVM)
MIT License
283 stars 48 forks source link

I need a better example of routing. #2

Closed findborg closed 9 years ago

findborg commented 9 years ago

I am having trouble getting the basic routing example to work. The one with the three divs.

nhanaswigs commented 9 years ago

Can you give me your setup?

findborg commented 9 years ago

nothing special at the moment. I am going to include your js in my app framework. I am just getting started to learn your code by just building small little modules. I have been able to practice with most of your examples except the routing one. I have the script loader and css loader working sofar. Looks like to me you have the code for the routing example in the shCore.js file and I was just trying to do an in-page script to get it going. I am updating my online rough draft when I have it up I will send you a link. I have been testing php frameworks to mix in with your js... Seems like the one I chose may be more difficult to configure on a live site than I want.... darn...

nhanaswigs commented 9 years ago

shCore.js is syntaz highlighter. You can refer to my example routing config source code

findborg commented 9 years ago

Here is the example you were asking for.
http://www.findborg.com/galaxy/demo/colors#user/100/details And I have reviewed your example. Makes sense for full pages. I was going to try and build tabs.... using the routing...

nhanfu commented 9 years ago

Hi @findborg I just move the repository due to brand name conflict, my old repo contains my old company name. I'm sorry for that.

Cheer,

findborg commented 9 years ago

No worries. It's all good.

nhanfu commented 9 years ago

Hi @findborg , Have you fixed the issue? Can I close this?

findborg commented 9 years ago

as you can see in the link that I provided you. It is still not working. Let me try to update the main script incase you have made some adjustments.

findborg commented 9 years ago

I'm pretty sure that I am doing something wrong. If you view source you can see that all I have done is tried to copy the example you give for routing in the docs. Should the code for the tabs be in the head instead of the bottom of the page?

nhanfu commented 9 years ago

You must add html.engine.min.js before using it. I see in the console that "Uncaught ReferenceError: html is not defined." Just move the script HtmlJs declaration up.

findborg commented 9 years ago

That was the problem. It is now working. The main content is being imported into the main layout of that page. So the script to make the tabs work was being loaded on top of the main call. You can close this.