The problem is that this code uses the "for property in object" syntax on an
array, which is wrong.

If you can, change that loop to be a standard indexed loop:

for (var i = 0; i < propArray.length; i++) {
    ...etc...
}

This is a common issue when dealing with legacy libs. Do not use the Array
object as an associative array. You should try to get a bugfix ticket opened
with the provider or community that authors that code, and get them to issue
a patch that uses indexed loops for all places where they currently have
this type of code.

On 6/18/07, john.krogh <[EMAIL PROTECTED]> wrote:
>
>
> Hi
>
> I'm a MOSS (sharepoint) developer and in my current project the design-
> layout from the advertising agency included fancy menu using Prototype
> and scriptaculous.
> MOSS has a HTML editor (webbased). When the user tries to activate the
> editor by clicking a link "EDIT CONTENT" it generates a JavaScript
> error.
>
> function AP_PopulateFromSerializedObjectQString( objectToPopulate,
> queryStringSegment )
> {
>         var currentWorkingQString=queryStringSegment
>         var indexOfQStringStart=queryStringSegment.indexOf("?");
>         if( -1 !=indexOfQStringStart )
>         {
>
> currentWorkingQString=queryStringSegment.substr(indexOfQStringStart);
>         }
>         var propArray=currentWorkingQString.split("&");
>         for( var i in propArray )
>         {
>                 var nameValuePair=propArray[i].split("="); //THIS IS THE
> ERROR
>                 if(nameValuePair.length==2)
>                 {
>
> objectToPopulate[nameValuePair[0]]=decodeURIComponent(nameValuePair[1]);
>                 }
>         }
> }
>
> Visual Studio says the error occurs in a files called
> "AssertPicker.js". this is a Sharepoint file.
>
> The onclick code of the "Edit Content" link is=
> "var params=new Array(); params[params.length] = new
> Array('ValidationContext', 'FONTS=true\u0026REUSABLECONTENT=true
> \u0026HEADINGS=true\u0026HYPERLINKS=true\u0026IMAGES=true
> \u0026LISTS=true\u0026TABLES=true\u0026TEXTMARKUP=true
> \u0026ISREQUIRED=false\u0026RESTRICTURLSTOSITECOLLECTION=false
> \u0026'); params[params.length] = new Array('CurrentWebBaseUrl',
> '\u002fHOME'); params[params.length] = new
> Array('DefaultAssetLocation', ''); params[params.length] = new
> Array('DefaultAssetImageLocation', ''); params[params.length] = new
> Array('AllowHtmlSourceEditing', 'True'); params[params.length] = new
> Array('EnableExtensions', 'True'); params[params.length] = new
> Array('EditorBackgroundColor', ''); params[params.length] = new
> Array('DisableCustomStyles', 'False'); params[params.length] = new
> Array('DisableBasicFormattingButtons', 'False'); params[params.length]
> = new Array('PrefixStyleSheet', 'ms-rte'); RTE2_LaunchEditor(params,
> 'ctl00_PlaceHolderMain_Content_ctl00_RichHtmlField',
> 'ctl00_PlaceHolderMain_Content_ctl00_RichHtmlField_DisplayHtmlPanel',
> 'ctl00_PlaceHolderMain_Content_ctl00_RichHtmlField_EmptyHtmlPanel',
> 'ctl00$PlaceHolderMain$Content$ctl00$RichHtmlField',
> encodeURI('\u002fHOME'), 'False');if (window.event)
> { window.event.returnValue = false; window.event.cancelBubble =
> true; } return false;"
>
> When I remove the       <script type="text/javascript" src="/Style
> Library/
> js/prototype.js"></script>
> everything works fine (except the fancy menu of cause ;-)
>
> Any ideas????
>
>
> >
>


-- 
Ryan Gahl
Manager, Senior Software Engineer
Nth Penguin, LLC
http://www.nthpenguin.com
--
Architect
WebWidgetry.com / MashupStudio.com
Future Home of the World's First Complete Web Platform
--
Inquire: 1-262-951-6727
Blog: http://www.someElement.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to