# Can i mix handlebars with javascript

**URL:** <https://forum.ghost.org/t/can-i-mix-handlebars-with-javascript/13929>\
**Category:** Developer help\
**Created:** [April 28, 2020, 10:15pm UTC](https://forum.ghost.org/t/can-i-mix-handlebars-with-javascript/13929 "2020-04-28T22:15:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![abdalla\_saleh](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/abdalla_saleh/32/6959_2.png) [@abdalla\_saleh](https://forum.ghost.org/u/abdalla_saleh)\
**Post date:** [April 28, 2020, 10:15pm UTC](https://forum.ghost.org/t/can-i-mix-handlebars-with-javascript/13929/1 "2020-04-28T22:15:43Z")

</div>

hello everyone ,  
i’m new to ghost so i was wondering if i can use handlebars with javascript code or if there is any way to workaround this , this is example about what i mean  
{{#foreach posts}}  
console.log(posts)  
{{/foreach}}

thanks in advance

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [April 29, 2020, 12:54am UTC](https://forum.ghost.org/t/can-i-mix-handlebars-with-javascript/13929/2 "2020-04-29T00:54:19Z")

</div>

If you’re trying to log the context, there’s a `{{log posts}}` helper. If you’re trying to do data transformations on the server (e.g. `posts[0].primary_author.name = 'bob'`), that’s intentionally not allowed

---

<div class="post-metadata">

**Author:** ![abdalla\_saleh](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/abdalla_saleh/32/6959_2.png) [@abdalla\_saleh](https://forum.ghost.org/u/abdalla_saleh)\
**Post date:** [April 29, 2020, 2:47am UTC](https://forum.ghost.org/t/can-i-mix-handlebars-with-javascript/13929/3 "2020-04-29T02:47:08Z")

</div>

thanks for your response  
no , this is not what i want .  
i’m creating search engine but i’m not allowed to use any plugin , so i’m working with vanilla javascript and wanna get posts to continue my script  
if you have any ideas about creating something like that please tell me  
thanks in advance
