Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7706691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:10:51+00:00 2026-06-01T00:10:51+00:00

A plugin I use on my site generates an array in this style: <script

  • 0

A plugin I use on my site generates an array in this style:

<script type="text/javascript">
  window.slideDetails = [ 

    //Slide1    
    "C1BP7: user information",
    "FJAD7: user information",
    "FFAD7: user information",
    //Slide2
    "C0AE7: user information",
    "C7AZ7: user information",
    "FJAE7: user information",
    //Slide3
    "C1AW7: user information",
    "FJAP7: user information",
    "FFAD7: user information"

    ]; 
</script>

I want to pass the first five characters to a cookie using the jQuery cookie plugin. Is it possible to truncate the array item to the first five characters?

I’m trying to get my head around the slice() but the different codes I’ve tried don’t work at all.

EDIT:

With thanks to andreas for his answer, I adapted it slightly to this:

window.slideCode = [], i;

  for(var i = 0; i < window.slideDetails.length; i++) { 
    window.slideCode.push(window.slideDetails[i].substr(0, 5));
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T00:10:52+00:00Added an answer on June 1, 2026 at 12:10 am
    for(var i = 0; i < window.slideDetails.length; i++) { 
        window.slideDetails[i] = window.slideDetails[i].substr(0, 5);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use this code: http://blogswizards.com/plugin-development/sliding-boxes-and-captions-with-jquery On a simple gallery site I am building. Specifically
I'm using qtranslate plugin for word press to use metalanguage in my site, How
I am trying to use these custom MacOSX-style check boxes on my site (it's
I have a site where I use a jquery slider plugin. For the previous/next
i want to use this plugin in my asp.net application i want to show
is there any body who knows what javascript plugin that about.me use ? especially
If i define a plugin in the <build> tag and want to use this
I use a plugin called quicksand in my wordpress theme this plugin load the
Is it possible to create Selenium tests using the Firefox plugin that use randomly
I am looking for a good jQuery pagination plugin to use in my aspx

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.