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

  • SEARCH
  • Home
  • 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 9236435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:17:31+00:00 2026-06-18T07:17:31+00:00

Given a comma-separated string of URLs, I want to open a separate window for

  • 0

Given a comma-separated string of URLs, I want to open a separate window for each element of its converted-to array, then submit a form.

The following code only opens one window, and no form submit takes place:

$.each(urlList.split(","), function (index, item) {

    urlList = "http://www.cnn.com,http://www.foxnews.com";

    _gaq.push(['_trackEvent', 'Results', 'Click', 'Classifieds+: ' + item + ' : ' + SourceUrlProviderID]);
    window.open(item, "_blank");
});
document.forms[0].submit();

When I do the following, I get the desired action – three new tabs/windows open, but I it looks like the form submit would be done twice and doesn’t quite make sense:

urlList = "http://www.cnn.com,http://www.foxnews.com";

// opens windows for each URL in the string
$.each(urlList.split(","), function (index, item) {
    _gaq.push(['_trackEvent', 'Results', 'Click', 'Classifieds+: ' + item + ' : ' + SourceUrlProviderID]);
    document.forms[0].submit();
    window.open(item, "_blank");
});

Can someone shed some light on this please?

  • 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-18T07:17:32+00:00Added an answer on June 18, 2026 at 7:17 am

    Why urlList is inside $.each? Anyway, I tried this, and works:

    var urlList = "http://www.cnn.com,http://www.foxnews.com"
    $.each( urlList.split( "," ), function( index, item ) {
        window.open( item, "_blank" )
    });
    document.forms[0].submit()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Problem:Given a comma separated string of numbers, want to find out the highest average
Given a List<int> how to create a comma separated string?
I want to create a comma-separated string like this. NSString *list = @iPhone,iPad,iPod; I
I have a comma separated string which i explode into an array. If the
Possible Duplicate: How to create comma separated list from array in PHP? Given this
Given a string of words separated by whitespace. Need to replace whitespaces with comma
I have string which contains every word separated by comma. I want to split
I am in a situation where I am given a comma-separated VarChar as input
I want to convert a string to a given generic type T . It
I have a program that returns a comma-separated string of numbers after doing some

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.