ok it turns out my method doesnt work after all :( after I got everything else working aswell... annoying :S
Matt Harris - the reason I have to use <script> is that not all people use PHP. I want my content to be compatible with any page type, as clients will be including it on their pages (html, php, asp, etc.) and Javascript is more compatible in this respect. On Aug 24, 9:41 pm, junkmate <[EMAIL PROTECTED]> wrote: > <script type="text/javascript" > src="http://yoursite.url/grabData.php?id=12345"></script> > yer I tried that... it didnt work. > PHP doesnt have the 'document.write' functionality that JS has... or > something, I forget the reason. > > I got it working in the end by using a JS script that calls an AJAX > function which calls PHP :D > A long way around perhaps, but it works... > > On Aug 24, 5:35 am, "Matt Harris" <[EMAIL PROTECTED]> wrote: > > > Why not > > <script type="text/javascript" > > src="http://yoursite.url/grabData.php?id=12345"></script> > > > And serve up the content via php*.... better yet, why even do a > > <script> include? > > > * Replace PHP here with your server side language of choice. > > > On 8/23/07, junkmate <[EMAIL PROTECTED]> wrote: > > > > I am trying to get a system where a client includes one or two lines > > > of Javascript in his page, and that code will grab dynamic data from > > > my server and display it inline on his page. > > > > My code for the JS to include on the clients page is something like > > > this: > > > <script type="text/javascript">var id="12345";</script> > > > <script type="text/javascript" src="http://my.site.url/grabData.js"></ > > > script> > > > > I then want to take that id, grab data from an SQL database, and print > > > it back to the clients page inline... but I dont know how to connect > > > to SQL using Javascript... anybody help? > > > -- > > Matt Harris > > (250)-588-2275 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
