1
Questions and Answers / Help required with IF-THEN filter
« on: August 21, 2002, 07:08:52 PM »
A site-specific filter I'm working on doesn't seem to work completely, even though it does work in the test fields.
I can't give out a test URl, as the site is password protected, but hopefully you'll be able to help me by looking at the source
Filter:
What this filter does, is add two or three required JS files, if they are missing. The first part always works (adding two more if only one is found), the second one only works in the test field.
This is the HTML that should match for #2 (And does, in the test view):
Note: the source document is missing its <html> tag, but that shouldn't matter, right?
Edited by - Jor on 21 Aug 2002 20:16:55
I can't give out a test URl, as the site is password protected, but hopefully you'll be able to help me by looking at the source
Filter:
Name = "Add Missing [Foo] Javascript"
Active = TRUE
URL = "www.foo.com"
Limit = 512
Match = "(<script *src="/javascripts.js" *</script> </head>"
"$SET(1=</head>)|"
"</style> </head>$SET(0=</style>
)$SET(1=(</head>
)))"
Replace = " "
"<script language="JavaScript" src="/fw_menu.js" "
"type="text/javascript"></script>
"
"<script language="JavaScript" src="/menu.js" "
"type="text/javascript"></script>
"
"<script language="JavaScript" src="/javascripts.js" "
"type="text/javascript"></script>
"
"1
$STOP()"
What this filter does, is add two or three required JS files, if they are missing. The first part always works (adding two more if only one is found), the second one only works in the test field.
This is the HTML that should match for #2 (And does, in the test view):
<head>
<style>
TD {font-size: 10pt;}
BODY {font-size: 10pt; font-family: Arial; color: FFFF80;}
</style>
</head>
<body bgcolor=black text=white link=FFFF80 vlink=FFFF80 alink=FFFF80>
<div style="text-align: center;">
Note: the source document is missing its <html> tag, but that shouldn't matter, right?
Edited by - Jor on 21 Aug 2002 20:16:55