Microsoft KB Archive/245236

= Type Mismatch Error Using the GetAd Method of Commerce.AdServer =

Article ID: 245236

Article Last Modified on 7/13/2004

-

APPLIES TO


 * Microsoft Site Server 3.0 Commerce Edition

-



This article was previously published under Q245236



SYMPTOMS
You may receive a type mismatch error when trying to call the GetAd method of the Commerce.AdServer object from JavaScript and you are passing in a TagList.



CAUSE
AdServer is expecting a variant array for the TagList parameter. JavaScript is passing the array as a dispatch pointer to a SimpleList object.



RESOLUTION
You cannot call the GetAd method from JavaScript directly if you are specifying a TagList. Instead, create a VBScript function that performs the communication with the AdServer object. You can then call this function from within your JavaScript.

Here is an example:

<%@ Language = JavaScript %>

 Function GetAd Set oAD = Application ("Ad") aArray = array ("position.banner.bottom") GetAd = oAD.GetAd (Response, aArray) End Function 

' ... code before ad is to be displayed goes here

<% Response.Write (GetMyAd ); %>

' ... code after ad is to be displayed goes here

Keywords: kbprb kbpending KB245236

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.