Solved

HTML Special Codes

Posted on 2013-06-27
21
238 Views
Last Modified: 2013-06-28
It appears that HTML special codes work sometimes but not all the time.

Using FireFox, please look at http://tchristy.net/dev/subcategory.php?pr=jse&cat=Hose+%26+Garden+&subcat=Sprayers&expandable=0&subexpandable=2&subsubexpandable=23

Notice the top item in the Sprayers list has the special character 1/2.

Then click Read More on that item. Note that the large text at the top has 3   Actual Gallon Sprayer. Note the special char for 1/2 is missing.

View Source. The code ½ (for 1/2) is there but not displayed.

Why?
0
Comment
Question by:Richard Korts
21 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39283097
Except that your image on the 'Read more' page does not show up in IE, it all works fine in IE and Firefox here.  You might want to remove the spaces on the left in front of your DOCTYPE and I don't know if IE likes 6 decimal places in the image width.  I've never used anything but integers for image width and height.

Oops, sorry, I missed the one in the header.  Have you checked to see if your font actually has the 1/2 character in it?  It doesn't necessarily have to.
0
 
LVL 6

Expert Comment

by:Michael
ID: 39283105
the 1/2 is indeed not showing up in Chrome.
Perhaps the reason is because you're using a cufon font which doesn't have the 1/2 character?
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39283107
Is this line supposed to be 'helvetica' instead of 'homevetica'?

<script type="text/javascript" src="js/homevetica_italic_900.font.js"></script>
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39283121
works on chrome
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39283148
No, it doesn't.
3 gallon
0
 

Author Comment

by:Richard Korts
ID: 39283152
Dave Baldwin,

Where are you seeing "homevetica"? It is not in the source of the product detail page.

Thanks
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39283160
Yes, it is.  Line 12.  Would I lie to you?
0
 

Author Comment

by:Richard Korts
ID: 39283164
To all,

This is at the bottom of some pages: <script type="text/javascript"> Cufon.now(); </script>

I inherited this design. What is Cufon_now() ?
0
 

Author Comment

by:Richard Korts
ID: 39283181
Here is a script in the js folder called by that name; it's source is attached.

What a mess, I don;t need all this I'm trying to do something simple.

Does that mean other HTML codes will not work either?
homevetica-italic-900.font.js
0
 

Author Comment

by:Richard Korts
ID: 39283184
Dave Baldwin:

The non integers on image dimensions are because they are calculated by php (based on the ACTUAL image size). I forgot to use intval(), etc.

Everything else works fine. I should clean that up, but............
0
 

Author Comment

by:Richard Korts
ID: 39283227
To Dave Baldwin

The lines with those several javascript references are in a file called scripts.php; it's attached.

As an experiment, I just removed all the lines near the top that start: <script type="text/javascript"

That made the 1/2 code to display on the detail page heading, but it screwed up a WHOLE bunch of other things.

My inclination is just to leave 1/2, 1/4, etc as 3 characters of text & forget the special codes; but I am using other special characters like the degree symbol, the R in a circle, etc.

Those are not USUALLY in the title, but I'm not positive they will not be used in other places where this cufon nonsense is in effect.

I'm getting the impression that cufon is only used in some places; but the css makes no references (in the css files).

What a mess!!
scripts.php
0
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 39283348
These four scripts are for the 'Cufon' font substitution.  I believe the 'Cufon_now()' activates the substitutions.
<script type="text/javascript" src="js/cufon-yui.js"></script>
<script type="text/javascript" src="js/helveticatitle_400-helveticatitle_700.font.js"></script>
<script type="text/javascript" src="js/homevetica_italic_900.font.js"></script>
<script type="text/javascript" src="js/custom.js"></script>

Open in new window

The middle two are the font definitions and the bottom one is basically the CSS redefinition for a number of elements.  A simple explanation: http://css-tricks.com/snippets/html/cufon-101/
0
 

Author Comment

by:Richard Korts
ID: 39284730
Dave Baldwin,

Do you think that if I removed Cufon_now() from a specific page it would stop activation of the cufon font (& thus NOT override the 1/2, etc., chars). I also thought of making an h1 style that was Arial, 18 pt, Italic so I could change that headline to a readable format.

Thanks
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39284894
I don't know for sure, I don't use Cufon.  Make a backup copy and try it.  That's what I would do.
0
 

Author Comment

by:Richard Korts
ID: 39284922
Dave Baldwin,

I tried a bunch of things; the cufon seems to override everything. Just to make sure the h1 styling was taking place, I made the font size enormous (32 pt); it does not take. Maybe I got it wrong. Does this look OK to you:

<h1 style="font-size: 32pt; font-family: Arial; font-style:italic;"><strong>content</strong></h1>
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39284996
"js/custom.js" re-styles a lot of things and I believe 'h1' is one of them.  It's probably overwriting what you are putting in there.
0
 

Author Closing Comment

by:Richard Korts
ID: 39285066
The problem is not solved; thanks for your efforts.

I need to explain to the client that we can't use those fraction codes.
0
 

Author Comment

by:Richard Korts
ID: 39285483
To Dave Baldwin

Can you look at this?

http://stackoverflow.com/questions/2738303/how-to-disable-cufon-on-certain-elements/2740784#2740784

The item by Michael Collier

I don't understand "Usage: remove_cufon('#name')".

What is #name? Is that the context of <a name="name">...</a> so I have to enclose the element I don;t want "cufonized" in this structure?
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39285750
I don't know.  You'll just have to try some things and see what works.
0
 

Author Comment

by:Richard Korts
ID: 39285956
Dave Baldwin

I figured it out; you put it in a div & give the div an id='h1ar'. Then in Javascript you put remove_cufon('#h1ar'); as well as those other functions.

It suppresses cufon. Now to find a font that looks ALMOST like that; Arial ain't close.

Thamks
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39285971
And that gets back to the original reason to use Cufon in the first place.  To use a font that Doesn't look like Arial or one of the standard web fonts.  I have this page to show what some of the most common fonts look like: http://www.dibsplace.com/webdev/fontshow.html
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Hide cell in a table 2 27
Index on a Table 6 25
Load data upon clicking a button 8 35
How to refresh a page from a sub domain in ajax ? 34 26
This article discusses four methods for overlaying images in a container on a web page
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question