I didn't write the code for the JavaScript search action but I don't see
anything unusual in the <script> section. Before the <script> section is
the following:
<@ASSIGN NAME="LOCAL$lvNameDescription" VALUE="<@MAP
ARRAY='LOCAL$lvAdvertisers' VALUE='<@REPLACE STR="#3 #5" FINDSTR="<@DQ>"
REPLACESTR="">'>">
What is the <@MAP> meta tag in the above code?
Below is the complete code. The script works if the taf runs on the same
server as the database. The script searches the webpage based on a keyword
submitted and creates a pop-up window of the results.
<@ASSIGN NAME="LOCAL$lvNameDescription" VALUE="<@MAP
ARRAY='LOCAL$lvAdvertisers' VALUE='<@REPLACE STR="#3 #5" FINDSTR="<@DQ>"
REPLACESTR="">'>">
<@ASSIGN NAME="LOCAL$lvNames" VALUE="<@VAR TYPE=TEXT
NAME='@@LOCAL$lvAdvertisers[*,3]' APREFIX='' ASUFFIX='' RPREFIX=''
RSUFFIX='' CPREFIX='<@DQ>' CSUFFIX='<@DQ>,'>">
<@ASSIGN NAME="LOCAL$lvNameAndDescription" VALUE="<@VAR TYPE=TEXT
NAME='@@LOCAL$lvNameDescription[*,1]' APREFIX='' ASUFFIX='' RPREFIX=''
RSUFFIX='' CPREFIX='<@DQ>' CSUFFIX='<@DQ>,'>">
<script language=javascript>
function dosearch(forx)
{
var textlabels=new Array(<@VAR NAME=LOCAL$lvNames ENCODING=NONE>"");
var textup=new Array(<@VAR NAME=LOCAL$lvNameAndDescription
ENCODING=NONE>"");
var fory;
var linkNums = new Array();
var linkNumsIndex = -1;
var linkNumsCounter = -1;
fory=-1;
// Find all occurences of the string and put the item numbers in an
array
while ((forx<textup.length))
{
if
((textup[forx].toLowerCase().indexOf((document.form1.iput.value).toLowerCase
())>-1)&&((document.form1.iput.value)!=""))
{
// Put the "found" item number into the array
linkNums[++linkNumsIndex] = forx+1;
}
forx++;
}
// If the array is not empty (that is, at least one occurence of the
search string was found),
// build and display a window with links (based on the array) to
the items.
// Else display a "not found" window.
newWindow =
window.open("","myChild","height=120,width=320,resizable=no,toolbar=no,scrol
lbars=yes,menubar=no,top=250px");
newWindow.document.clear();
newWindow.document.write("<HTML><TITLE>Smithsonian Reader
Search</TITLE><BODY BGCOLOR=FFFFFF>\n");
if (!(linkNumsIndex == -1)) {
while (linkNumsCounter++ < linkNumsIndex) {
newWindow.document.write('<a href="#Adv_' +
(linkNums[linkNumsCounter]) + '" target="main">' +
(linkNums[linkNumsCounter])+'. '+ (textlabels[linkNums[linkNumsCounter]-1])
+'</A><BR>');
}
}
else {
newWindow.document.write("No items found.<BR>");
}
newWindow.document.write("<a href=" + window.location + "
onclick='window.close()' target='main'>Return to search</A><BR>\n");
newWindow.document.write("</BODY></HTML>");
newWindow.document.close();
newWindow.focus();
self.name = "main";
self.location.href="#"+(linkNums[0]);
}
function startup() {
dosearch(0);
}
</SCRIPT>
Thanks
Ted
-----Original Message-----
From: Scott Cadillac [mailto:[EMAIL PROTECTED]
Sent: Friday, July 25, 2003 9:48 AM
To: [EMAIL PROTECTED]
Subject: RE: Witango-Talk: Javascript Error
Hi Ted,
Client-side JavaScript is typically just part of your text output. Witango
literally ignores all the text you have in a TAF, that is not part of your
Metatag code, i.e., HTML, CSS, JavaScript.
I think it's possible the JavaScript error is just somehow masking the real
error, making it difficult for you to see it on your page.
Try commenting out all JavaScript and see what you can find.
Hope this helps. Cheers...
Scott Cadillac,
XML-Extranet - http://xml-extra.net
403-281-6090 - [EMAIL PROTECTED]
Well-formed Development
--
Extranet solutions using C# .NET, Witango, MSIE and XML
> -----Original Message-----
> From: Ted Wolfley [mailto:[EMAIL PROTECTED]
> Sent: Friday, July 25, 2003 6:24 AM
> To: '[EMAIL PROTECTED]'
> Subject: Witango-Talk: Javascript Error
>
>
> Hi,
>
> I am replacing one win2000 server (A) to another faster
> win2000 server. The
> new server (B) contains the Rbase databases that are
> connected to RTango2000
> running on another win2000 server (C)with Oterro 2.6 odbc.
> The web pages
> will not work if I have a JavaScript in the taf if the odbc
> looks at the new
> server (B). The web pages with JavaScript will work if
> either the odbc is
> looking at the old server (A) or I move the taf to the new
> server (B) and
> run the web pages from there. Is there a setting I missed?
>
> Ted ______________________________________________________________
> __________
> TO UNSUBSCRIBE: Go to http://www.witango.com/maillist.taf
>
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/maillist.taf
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/maillist.taf