purple oar software

"Ensuring Your Web Presence Contributes"

admin's blog

Javascript errors, line numbers from IE

admin's picture

Recently I received an email from Gary who tried out my shareware Javscript editor, ScrypTik. I tried to reply directly, but his email bounced. Gary's question was a good one, so I'll answer it here as it may help others.

Question:

I have downloaded a copy of ScrypTik and I like what it can offer. However, I have the following issue which is typical of my application:

I have a PHP file which refers to numerous js files

e.g.
When running the PHP, The IE browser (v7) will refer to a line number "line 706: character 3" which bears no relation to my PHP source file. It seems to be erroring on some Javascript at run-time. I know this is a run-time error since it occurs in specific situations.

What is the best way of locating the error with your product?

My Answer:

Javascript code filter for Drupal

admin's picture

Here is an explanation of how I wrote a Drupal5.n module to filter javascript code so that it displays syntax highlighted. To illustrate what it does:-

/*
 * comment block
 *
 */


// single line comment


function
example(a,c) {
  return
a * c * 59;
}


document
.writeln("this is a text string");
document
.writeln('so is this, single quoted');

If the code is just a single line it will display without the background div:

var myDiscount = 0.25;

The filter system within Drupal is intended to make data entry into the CMS easy and safe. URL's can become clickable and malicious HTML (and rude words) can be stripped out. This js_filter module, based on the contributed codefilter module by John Wilkins, will syntax highlight Javascript code. There are already ways to do this within Drupal, the geshifilter module which uses the third-party GeSHi PHP library will syntax highlight many languages and there is also a jQuery plugin, jquery-chili-js which uses "recipes" for several languages.

js_filter has no software dependencies, it is purely PHP module code.

SEO, the loooooooooong tail

admin's picture

This site is about web development. I provide web design and development services. It is optimized for words like "web development" plus my geographic location.

But this site is found most frequently by a phrase (or variation) to do with the difference between static and dynamic web sites. This is NOT what I anticipated.

However, if people are coming to my site from a google search for "difference between static and dynamic web sites", there must be a reason.

Read more . . .
Category(s)

Web story, the beginning

admin's picture

Every web site owner has a story or three to tell.

Most web site owners want to make money from their site.

Lots of web sites offer advice on how to do this (jargon "monetize"). Probably the most popular business on the Internet is how to make money on the Internet! They urge you to buy their latest snake oil system which will have you earning indecent amounts of money in hardly any time at all. Their spiel is awash with numerous testimonials from customers draped over their latest Ferrari/beautiful significant other which proves how much money they are making.

Beware, low flying pigs!

Collage of Nelson Haven and the Cut

admin's picture

My wife created this, I think its great!
 

Collage of Nelson Haven and the Cut
Copyright © 2006 - 2008 by Diana Roper, all rights reserved.
Category(s)

Family Art

admin's picture

My step daughter sketched this, I think its cool so now its published!
 

Two faces by Natalie Britten
Copyright © 2006 by Natalie Britten, all rights reserved.
Category(s)
Syndicate content