English 中文(简体)
将 Java印功能与铁路应用相结合
原标题:Integrating Javascript functions with Grails application

正在将网络应用从PHP/MySQL背书转向Grails框架。 然而,这部书有一套我喜欢用微薄的重写来书写的遗产单。 它目前不工作,我不肯定为什么。

一位朋友写了一幅幻灯片,需要一个阵列作为初步的阵列。

var images[3];
images[0] = [ path to image ,  link to somewhere ,  target ];

在PHP撰写文章时,我刚刚使用了相对的道路,并用两条文字来说明链接和目标,即:

images[0] = ["../images/file.jpg", "", ""]

绕过Grails,我想把幻灯光放在所有页上,从而转而插入主机。

I ve宣布头部的javascript链接为

<g:javascript src="fade_in.js" />

原始文字的制作方式是,图像阵列在文字中被公用,然后通过体码中的功能传承。 由于我不知道是否有可能在js文档中使用Grails createLinkTo功能,我先入选阵列,称其功能。

<div id="slideshow">
  <script type="text/javascript">
        var images[3];
        images[0] = ["<g:createLinkTo dir= images  file= nsf.jpg  />", "", ""]
        images[1] = ["<g:createLinkTo dir= images  file= east.jpg />", "", ""]
        images[2] = ["<g:createLinkTo dir= images  file= usm_horz.png  />", "", ""]
        new fadeshow(fadeimages,200,118,0,8000,1,"R");                          
  </script>
</div>

据火力袭击称,查阅档案的途径是正确的,但并没有在规定的干燥位置上显示。 我可以看到这些图像应当在哪里,而且其空洞。

因此,需要做些什么,才能将这一功能与全球铁路连接起来?

最佳回答

You can not use GSP tags in a .js file unless you have mapped the js file as gsp. You can create a gsp file eg fade_in.gsp that would declare the images array.

Eg - fade_in.gsp

<script>
   //you initialize your javascript array here - you can use all gsp tags.
</script>

然后,将这一片面文件列入需要图像阵列的其他网页。

问题回答

暂无回答




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签