A newbie question about curly-bang and compiler

7 views
Skip to first unread message

pointer

unread,
May 8, 2009, 9:52:23 AM5/8/09
to Flapjax
Hi i'm newcomer to flapjax. it's very interesting for me, but i
encounter a problem when getting my hands into it.

i have been following flapjax tutorial page and tried to make a sample
page with some curly-bang syntax like {! timerB(100) !}. but it doesnt
work in my browsers even though there's <script type="text/javascript"
src="lib/flapjax/flapjax.js"></script> in html head. (im sure path and
filename are correct)

however, i found a way it works. if i add loader function, function
loader(){ insertDomB(timerB(100), 'timer'); } and load it
when html body initiates, it's working perfectly. i'm curious why i
cannot directly use curly-bang statements in html code. it always
display plain text. i think it may have something to do with compiler,
but.. where's flapjax compiler and how to make it compile flapjax
code?

thanks for any tips in advance.

Arjun Guha

unread,
May 8, 2009, 9:57:51 AM5/8/09
to fla...@googlegroups.com
Hello,

{! !} ought to work direcly in HTML without insertDomB. Can you send
us the full HTML for your program? We should be able to spot your
problem (or our bug) quickly. Here's an inline use of timerB that
works on the web compiler:

<html>
<head>
<title>Flapjax Demo: Where is the Mouse?</title>
<link rel="stylesheet" href="/demo.css"/>
</head>

<body>

<p>The mouse coordinates are
&lt; {! timerB(1000) !} &gt;
</p>

</body>

</html>

pointer

unread,
May 8, 2009, 10:19:13 AM5/8/09
to Flapjax
Hi there,

thanks for prompt reply! here is my sample full html code:

<html>
<head>
<script type="text/javascript" src="./flapjax.js">
</script>
<title>Flapjax Demo: Time 1</title>
</head>
<body>
<p>
The time is {! timerB(1000) !}.
</p>
</body>
</html>

I think it's supposed to work. flapjax.js just downloaded from flapjax
site, and i copied it to html file directory. but it always shows
plain text {! timerB(1000) !} no matter in FF or IE.

Thanks for your time!

Arjun Guha

unread,
May 9, 2009, 9:27:20 AM5/9/09
to fla...@googlegroups.com
> I think it's supposed to work. flapjax.js just downloaded from flapjax
> site, and i copied it to html file directory. but it always shows
> plain text {! timerB(1000) !} no matter in FF or IE.

{! !} is a feature of the Flapjax compiler. If you want {! !} to
work, you have to let our compiler process your HTML. You can use the
compiler directly from your browser:

www.flapjax-lang.org/try

Alternatively, if you want to use the compiler locally, you can
install it from source:

http://groups.google.com/group/flapjax/browse_thread/thread/555975244300955c

Arjun

Reply all
Reply to author
Forward
0 new messages