# Javascript include issue

**URL:** <https://www.ruby-forum.com/t/javascript-include-issue/107990>\
**Category:** Rails\
**Created:** [June 28, 2007, 5:33am UTC](https://www.ruby-forum.com/t/javascript-include-issue/107990 "2007-06-28T05:33:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Camo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ce7236/32.png) [@Camo](https://www.ruby-forum.com/u/Camo)\
**Post date:** [June 28, 2007, 5:33am UTC](https://www.ruby-forum.com/t/javascript-include-issue/107990/1 "2007-06-28T05:33:26Z")

</div>

Hey guys,

I’ve started working on a codepress plugin, ([codepress.org](http://codepress.org))

however I am having a problem with the javascript include via ruby  
code, rails adds ?something to stop caching,

however this ?soemthing is affecting the actual javascript, take it  
out and it works

Any help would be great

Cheers Cameron

---

<div class="post-metadata">

**Author:** ![Camo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ce7236/32.png) [@Camo](https://www.ruby-forum.com/u/Camo)\
**Post date:** [June 28, 2007, 5:48am UTC](https://www.ruby-forum.com/t/javascript-include-issue/107990/2 "2007-06-28T05:48:27Z")

</div>

it’s called asset timestamping and i can’t say that i have ever heard  
of this ever causing a problem. rails is just adding the file’s  
modification time to the end of the url. it shouldn’t have any effect  
on retrieving the file or executing any code within it.

can you be more specific as to what the problem is?

---

<div class="post-metadata">

**Author:** ![Camo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ce7236/32.png) [@Camo](https://www.ruby-forum.com/u/Camo)\
**Post date:** [June 28, 2007, 9:02am UTC](https://www.ruby-forum.com/t/javascript-include-issue/107990/3 "2007-06-28T09:02:43Z")

</div>

I didn’t think it would affect it either, however it seems to be

Ok this what I have done to replicate the error

went to [codepress.org](http://codepress.org) got the latest code,

included it in my layout like the following \<%= javascript\_include\_tag  
“codepress/codepress”%\>

then in my view i have went \<%= f.text\_area :content, :class =\>  
“codepress javascript” %\>

No when i do this i get the following error (In Firefox)

self.editor.setCode is not a function  
self.editor.setCode(self.textarea.value);

when I hard code the javascript include i get no javascript errors and  
it works fine.

---

<div class="post-metadata">

**Author:** ![Camo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ce7236/32.png) [@Camo](https://www.ruby-forum.com/u/Camo)\
**Post date:** [June 28, 2007, 3:45pm UTC](https://www.ruby-forum.com/t/javascript-include-issue/107990/4 "2007-06-28T15:45:34Z")

</div>

just to make sure, you put the codepress/ directory in  
public/javascripts/ correct? that would make the full src path  
“/javascripts/codepress/codepress.js”

---

<div class="post-metadata">

**Author:** ![Camo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ce7236/32.png) [@Camo](https://www.ruby-forum.com/u/Camo)\
**Post date:** [June 29, 2007, 7:56am UTC](https://www.ruby-forum.com/t/javascript-include-issue/107990/5 "2007-06-29T07:56:35Z")

</div>

yes that is correct, its only when there is the assest timestamp that  
i get an issue

On Jun 28, 11:44 pm, “Chris H.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
