# Basic javascript questions



## cute.bandar (Jul 1, 2011)

I am not learning javascript ATM , but want to know how to do a couple of things for a php project.

Problem 1.
This page: Zenfolio has a nice javascript effect. Click on 'send message' and via onmousedown event a method is called.
But this doesn't work if I save the source of the page locally and then run the local file. Why?

Exact Steps:

save source of Zenfolio | G i a n m a r i o M a s a l a A r t w o r k s | Contact into a file (local.html)
run local.html
click on send message to see that javascript effect doesn't work.


----------



## abhidev (Jul 1, 2011)

what effect is that......also have you downloaded the js files???


----------



## cute.bandar (Jul 1, 2011)

effect: just calls a function to rewrite the a href.
I didn't download the js files , but tried to set the paths right (relative to absolute)...Is there a way to find the exact relevant js file? so that i won't have to plough through the source code?


----------



## abhidev (Jul 1, 2011)

onmousedown it just posts the form, hides it and then shows the message.

I didn't get what effect are you talking abt


----------



## cute.bandar (Jul 1, 2011)

> onmousedown it just posts the form, hides it and then shows the message.


 yes thats what I meant by effect. sorry for being confusing. 

SO how do I get it working locally? can someone try it on their machine ?


----------



## abhidev (Jul 1, 2011)

u just need to set the path of the js files correct...and that should work...also don't forget to host it on the server because for ajax to work it should be hosted on the server...also edit the js file and write the entire url '*gianmariomasala.zenfolio.com/zf/layout/layout.asmx'


----------



## cute.bandar (Jul 1, 2011)

ok I'll try...
btw how did you figure out it was posting using ajax ?


----------



## abhidev (Jul 1, 2011)

cute.bandar said:


> ok I'll try...
> btw how did you figure out it was posting using ajax ?



its not refreshing the page right...so it means its using ajax...


----------

