Solved

HTML Special Codes

Posted on 2013-06-27
21
235 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 82

Expert Comment

by:Dave Baldwin
Comment Utility
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
Comment Utility
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 82

Expert Comment

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

<script type="text/javascript" src="js/homevetica_italic_900.font.js"></script>
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
Comment Utility
works on chrome
0
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
No, it doesn't.
3 gallon
0
 

Author Comment

by:Richard Korts
Comment Utility
Dave Baldwin,

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

Thanks
0
 
LVL 82

Expert Comment

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

Author Comment

by:Richard Korts
Comment Utility
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
Comment Utility
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
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:Richard Korts
Comment Utility
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 82

Accepted Solution

by:
Dave Baldwin earned 500 total points
Comment Utility
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
Comment Utility
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 82

Expert Comment

by:Dave Baldwin
Comment Utility
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
Comment Utility
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 82

Expert Comment

by:Dave Baldwin
Comment Utility
"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
Comment Utility
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
Comment Utility
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 82

Expert Comment

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

Author Comment

by:Richard Korts
Comment Utility
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 82

Expert Comment

by:Dave Baldwin
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

743 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now