lindell Posted December 11, 2006 Share Posted December 11, 2006 Hi, i want to do a function which gets a random name from my MySQL database and then delivers it in a javascript alertbox. If i got this right, i have to use AJAX or something like that, and I REALLY ###### at AJAX, so now i wonder if you can help me with this small function?Sorry for my bad english.Thanks! Link to comment Share on other sites More sharing options...
aspnetguy Posted December 11, 2006 Share Posted December 11, 2006 Are you using PHP on the server side? Do you have the PHP already written?Post everything you have so far and we'll go from there. Link to comment Share on other sites More sharing options...
lindell Posted December 11, 2006 Author Share Posted December 11, 2006 No i'm using ASP. I tried to use Javascript which called for an ASP function, this didn't work. <!-- #include file="connect.asp" --><%function databas()call baseopen(connect)SQL = "Select namn from namntips order by rand() Limit 1"set recset = connect.execute(SQL)end function%><script type=text/JavaScript><!--function namntips(){<%call databas()%>alert('<%=recset("namn")%>');}//--></SCRIPT><a href="java script: namntips()">Namntips</a> Link to comment Share on other sites More sharing options...
aspnetguy Posted December 11, 2006 Share Posted December 11, 2006 ok, you really should read the AJAX tutorial, there are some really easy examples that should answer this question for you.Let us know if you still need help after that. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now