Java and Wordpress

I don't speak coffee!

Page 1 of 1

5 Replies - 7790 Views - Last Post: 18 February 2006 - 05:03 PM

#1 bug  Icon User is offline

  • Got Bug?
  • member icon

Reputation: 0
  • View blog
  • Posts: 1,010
  • Joined: 24-April 05

Java and Wordpress

Posted 17 February 2006 - 04:14 PM

Ok so, I'm trying to get a javascript to work inside of a wordpress post. Wordpress's formatting is interfearing with the scripts tags rendering it useless. After doing a little reasearch I found this article that gives a workaround for putting a javascript in a post:

http://codex.wordpre...script_in_Posts

I tried to follow it but I'm not doing something correctly because it's not working.

Here's the javascript code I need to insert into the post:


 
<!-- Start PayPal Button Code -->
<!-- Krystal Appeal (12) -->
<!-- Generated By Pet Samaritans -->
<!-- http://www.petsamaritans.co.uk/donate -->
<script src="http://www.petsamaritans.co.uk/donate/showbutton.php?i=1&item=12&width=170&direction=vertical&showtop5=yes&background=gray&graph1=red&graph2=maroon&text=white">
</script>
<!-- End PayPal Button Code -->



I'd be wicked appreciative if someone could take a look at their instructions and "translate" for me what I should be doing in simple steps...Thanks :)

Is This A Good Question/Topic? 0
  • +

Replies To: Java and Wordpress

#2 skyhawk133  Icon User is offline

  • Head DIC Head
  • member icon

Reputation: 1868
  • View blog
  • Posts: 20,280
  • Joined: 17-March 01

Re: Java and Wordpress

Posted 17 February 2006 - 04:22 PM

Java != Javascript

Moved to appropriate forum.
Was This Post Helpful? 0
  • +
  • -

#3 bug  Icon User is offline

  • Got Bug?
  • member icon

Reputation: 0
  • View blog
  • Posts: 1,010
  • Joined: 24-April 05

Re: Java and Wordpress

Posted 17 February 2006 - 05:12 PM

*chuckle* A prime example that I have no idea about anything Java related ;)
Was This Post Helpful? 0
  • +
  • -

#4 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,506
  • Joined: 12-July 02

Re: Java and Wordpress

Posted 17 February 2006 - 06:35 PM

Well, you've got the source pointing to what looks like a php file...technically (according to their instructions) that source attribute should be pointing towards a javascript file...the one that contains the function you wish to run.
Also, there does not appear to be a function call in the script tags.

Do you have the javascript you wish to run in a separate file?
Was This Post Helpful? 0
  • +
  • -

#5 1lacca  Icon User is offline

  • code.rascal
  • member icon

Reputation: 44
  • View blog
  • Posts: 3,822
  • Joined: 11-August 05

Re: Java and Wordpress

Posted 18 February 2006 - 04:36 PM

Amadeus, on 17 Feb, 2006 - 07:32 PM, said:

Well, you've got the source pointing to what looks like a php file...technically (according to their instructions) that source attribute should be pointing towards a javascript file...the one that contains the function you wish to run.
Also, there does not appear to be a function call in the script tags.

Do you have the javascript you wish to run in a separate file?

Being a PHP file is not the problem, it simply indicates that the Javascript file is generated by a PHP script dynamically - I assume that it sets the content type as text/javascript, too.
Also, the function call is not needed, as it is not a function, so it is executed right where it is included - namely that couple of document.write calls insert the form into the page.

Bug, its hard to help like this, we should see somehow the results. If you could copy the source of the page that wordpress generates, that would make things much simpler - actually the whole thing is not needed, just the first part until the closing head tag, and the part where the script is included from <script ... > to </script>.

And document.write does not work on XHTML pages served as XML, but I don't think that this is the problem here.
Was This Post Helpful? 0
  • +
  • -

#6 1lacca  Icon User is offline

  • code.rascal
  • member icon

Reputation: 44
  • View blog
  • Posts: 3,822
  • Joined: 11-August 05

Re: Java and Wordpress

Posted 18 February 2006 - 05:03 PM

And if your page is xhtml, try adding the type attribute into the script tag - and even if it is not change & into &amp; to validate correctly:
<script type="text/javascript" src="http://www.petsamaritans.co.uk/donate/showbutton.php?i=1&amp;item=12&amp;width=170&amp;direction=vertical&amp;showtop5=yes&amp;background=gray&amp;graph1=red&amp;graph2=maroon&amp;text=white">
</script>


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1