Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Terms not recognised in FireFox or Chrome - Help please

Status
Not open for further replies.

tchaplin

Programmer
Jul 18, 2003
58
NZ
Hi

I have a legacy website working in IE however it doesn't work Chrome or Firefox it written in ASP there is some jscript. There must be some terms that are not recognized in Firefox or Chrome - Could someone pint me in the right direction. Code below - Thanks for your input Todd


my test - alert('Hello, ' + ProductID); only works in IE
jscript ----
function addProduct(ProductID, ProductType) {
answer = confirm("This item will be added to your shopping cart\n\nClick OK to add to your Cart\nClick CANCEL to go back");
if (answer) {
//alert("additem.asp?ProductID=" + ProductID);
if (document.all) {
if (ProductType=='Bear') {
BearCertWindow=window.open('/birthcert.asp?ProductID='+ProductID,'400x500','toolbar=no,status=no,scrollbars=yes,location=no,menubar=no,directories=no,width=640,height=440');BearCertWindow.focus();
}
alert('Hello, ' + ProductID);
document.frames.hiddenframe.document.location = "/shop/additem.asp?ProductID=" + ProductID
} else {
if (ProductType=='Bear') {
BearCertWindow=window.open('/birthcert.asp?ProductID='+ProductID,'400x500','toolbar=no,status=no,scrollbars=yes,location=no,menubar=no,directories=no,width=640,height=440');BearCertWindow.focus();
}
document.layers.hiddenframe.src = "/shop/additem.asp?ProductID=" + ProductID
}
}
}

The page additem.asp --- only includes
<%@ Language=VBScript %>
<!-- #include virtual="/_include/connection.asp" -->
<%
comm.CommandText = "SP_AddItem"
comm("@CartID") = Request.Cookies("CartID")
comm("@ProductID") = cint(request("ProductID"))
comm("@ExtraInfo") = ""
comm.Execute
Response.Redirect "/shop/carttotal.asp?TempID=" & server.URLEncode(now)
%>

 
I think the problem is in the additem.asp

Are there some browser compatibility issues? How to convert?

<%@ Language=VBScript %>
<!-- #include virtual="/_include/connection.asp" -->
<%
comm.CommandText = "SP_AddItem"
comm("@CartID") = Request.Cookies("CartID")
comm("@ProductID") = cint(request("ProductID"))
comm("@ExtraInfo") = ""
comm.Execute
Response.Redirect "/shop/carttotal.asp?TempID=" & server.URLEncode(now)
%>
 
[0] The problem most probably relates to the referencing html element. Server-side part should be independent of that, although it can contain error of its own.

[1] It is not clear what "hiddenframe" is, a name attribute? an id?... and what the frame is, inline?, frameset?...

[2] In case you can put a name attribute to the frame, you can do this which has a better chance of being cross-browser ie/ff.
[tt]
function addProduct(ProductID, ProductType) {
var answer = confirm("This item will be added to your shopping cart\n\nClick OK to add to your Cart\nClick CANCEL to go back");
if (answer) {
//alert("additem.asp?ProductID=" + ProductID);
//[red]what is "400x500"! It is meant to be the name of the window?[/red]
if (ProductType=='Bear') {
BearCertWindow=window.open('/birthcert.asp?ProductID='+ProductID,'400x500','toolbar=no,status=no,scrollbars=yes,location=no,menubar=no,directories=no,width=640,height=440');
BearCertWindow.focus();
}
[red]window[/red].frames.hiddenframe.document.location = "/shop/additem.asp?ProductID=" + ProductID;
}
}
[/tt]
[2.1] To be more sure, you have to show the structure of frames.
 
Thanks for your reply (very much appreciated).

I have done a little more investigative work and worked out that the items are being written to cookies and passing variables using query strings.

Somewhere there is a problem extracting the product id out of the db and presenting the contents??? Where ??? humm??

Can you explain what the comm object is and how to get the contents out of it say for comm("@ProductID") .


comm.CommandText = "SP_AddItem"
comm("@CartID") = Request.Cookies("CartID")
comm("@ProductID") = cint(request("ProductID"))
comm("@ExtraInfo") = ""
comm.Execute

Thanks Todd



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top