# Running an rjs function on page load

**URL:** <https://www.ruby-forum.com/t/running-an-rjs-function-on-page-load/159030>\
**Category:** Rails\
**Created:** [January 30, 2009, 4:20pm UTC](https://www.ruby-forum.com/t/running-an-rjs-function-on-page-load/159030 "2009-01-30T16:20:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![spacechurro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d2c977/32.png) [@spacechurro](https://www.ruby-forum.com/u/spacechurro)\
**Post date:** [January 30, 2009, 4:20pm UTC](https://www.ruby-forum.com/t/running-an-rjs-function-on-page-load/159030/1 "2009-01-30T16:20:28Z")

</div>

i am currently working on a function that adds markers to a map…

without getting into too much detail, the map is initially in a  
display:none div… so, i had to do a few things to get it to show up  
correctly…

initially, i needed to add markers when the user clicked a link. i did  
this with a call to an rjs… this just pushed new markers onto the  
page…

we now want to add these markers on page load…

is there a way i can fire this off once, after the page is loaded…  
without any user intervention?
