The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Using charts from http://chart.apis.google.com, cant validate HTML
loodafan
post Aug 9 2009, 11:52 AM
Post #1





Group: Members
Posts: 5
Joined: 9-August 09
Member No.: 9,372



Hi, I have a problem.
On my site I am using a chart with help from http://chart.apis.google.com.
However, this makes the site invalid when I try to validate it. This is because of the ampersands (&'s) in the url.
But the problem is, if I try to fix it using "amp", the chart will not work.

Does anyone have a solution for this?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Frederiek
post Aug 9 2009, 11:58 AM
Post #2


Programming Fanatic
********

Group: Members
Posts: 5,146
Joined: 23-August 06
From: Europe
Member No.: 9



Encode them as "&" (without the quotes).

Sorry, the forum soft rendered the wrong code. It should read "& amp ;" (without the quotes and spaces this time).

This post has been edited by Frederiek: Aug 9 2009, 12:00 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
loodafan
post Aug 9 2009, 12:22 PM
Post #3





Group: Members
Posts: 5
Joined: 9-August 09
Member No.: 9,372



QUOTE(Frederiek @ Aug 9 2009, 11:58 AM) *

Encode them as "&" (without the quotes).

Sorry, the forum soft rendered the wrong code. It should read "& amp ;" (without the quotes and spaces this time).



As I wrote in the post, if I do this, the chart will not work.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Aug 9 2009, 02:54 PM
Post #4


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



That sounds very strange. Can we see?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
loodafan
post Aug 9 2009, 04:12 PM
Post #5





Group: Members
Posts: 5
Joined: 9-August 09
Member No.: 9,372



QUOTE(loodafan @ Aug 9 2009, 12:22 PM) *

QUOTE(Frederiek @ Aug 9 2009, 11:58 AM) *

Encode them as "&" (without the quotes).

Sorry, the forum soft rendered the wrong code. It should read "& amp ;" (without the quotes and spaces this time).



As I wrote in the post, if I do this, the chart will not work.



Yes, this is the link I use as the image of the chart: http://chart.apis.google.com/chart?chxt=x,...p;chxl=0:|40.32 kr||

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Aug 9 2009, 05:06 PM
Post #6


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



Is the " kr||" at the end supposed to be there? Doesn't work with that.

Anyway, the link works for me with the ampersands escaped.
http://chart.apis.google.com/chart?chxt=x,...p;chxl=0:|40.32
CODE
http://chart.apis.google.com/chart?chxt=x,y&chs=70x250&cht=bvs&chd=t:0.0004032|100&chco=FFFFFF,FF00CC&chxt=x,y&chxl=0:|40.32
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
loodafan
post Aug 10 2009, 01:34 AM
Post #7





Group: Members
Posts: 5
Joined: 9-August 09
Member No.: 9,372



QUOTE(pandy @ Aug 9 2009, 05:06 PM) *

Is the " kr||" at the end supposed to be there? Doesn't work with that.

Anyway, the link works for me with the ampersands escaped.
http://chart.apis.google.com/chart?chxt=x,...p;chxl=0:|40.32
CODE
http://chart.apis.google.com/chart?chxt=x,y&chs=70x250&cht=bvs&chd=t:0.0004032|100&chco=FFFFFF,FF00CC&chxt=x,y&chxl=0:|40.32



Yes the "kr||" should be there, this is very strange, when I use your link. I get:

Bad Request
Your client has issued a malformed or illegal request.
Chart width must be at least 1 pixel.
'

From google, so it dosent work for me, which browser did you test the chart in?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Aug 10 2009, 08:56 AM
Post #8


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



CODE
Yes the "kr||" should be there,


OK, but then that must be URL encoded, since both spaces and horizontal bars are "illegal" in URLs. %20kr%7C%7C should do it. Now I spot two other pipes that also needs URL encoding. Oops!
See further about URL encoding here: http://www.blooberry.com/indexdot/html/top...urlencoding.htm .

QUOTE
so it dosent work for me, which browser did you test the chart in?


Don't remember, but I tested again now in IE6, K-Mel (gecko), Opera and Safari Windows. It also works with the end bit added as long as it's URL encoded. Get the same chart in both cases.
http://chart.apis.google.com/chart?chxt=x,...0.32%20kr%7C%7C
CODE
http://chart.apis.google.com/chart?chxt=x,y&chs=70x250&cht=bvs&chd=t:0.0004032%7C100&chco=FFFFFF,FF00CC&chxt=x,y&chxl=0:%7C40.32%20kr%7C%7C


What the heck do you use for a browser?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
loodafan
post Aug 10 2009, 12:22 PM
Post #9





Group: Members
Posts: 5
Joined: 9-August 09
Member No.: 9,372



QUOTE(pandy @ Aug 10 2009, 08:56 AM) *

CODE
Yes the "kr||" should be there,


OK, but then that must be URL encoded, since both spaces and horizontal bars are "illegal" in URLs. %20kr%7C%7C should do it. Now I spot two other pipes that needs also neeeds URL encoding. Oops!
See further about URL encoding here: http://www.blooberry.com/indexdot/html/top...urlencoding.htm .

QUOTE
so it dosent work for me, which browser did you test the chart in?


Don't remember, but I tested again now in IE6, K-Mel (gecko), Opera and Safari Windows. It also works with the end bit added as long as it's URL encoded. Get the same chart in both cases.
http://chart.apis.google.com/chart?chxt=x,...0.32%20kr%7C%7C
CODE
http://chart.apis.google.com/chart?chxt=x,y&chs=70x250&cht=bvs&chd=t:0.0004032%7C100&chco=FFFFFF,FF00CC&chxt=x,y&chxl=0:%7C40.32%20kr%7C%7C


What the heck do you use for a browser?


Dont know what I did wrong before, but now it works perfect!
Thanks a million.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Aug 10 2009, 12:56 PM
Post #10


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



But you said MY link didn't work? Didn't you mean when you just clicked it from here? I mean, in that case you couldn't do anything wrong. unsure.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 24th April 2024 - 08:45 PM