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 8700033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:05:39+00:00 2026-06-13T02:05:39+00:00

I found this script at Stack Overflow: window.params = function(){ var params = {}; var

  • 0

I found this script at Stack Overflow:

window.params = function(){
    var params = {};
    var param_array = window.location.href.split('?')[1].split('&');
    for(var i in param_array){
        x = param_array[i].split('=');
        params[x[0]] = x[1];
    }
    return params;
}();

This splits a URL into data, like PHP does with $_GET.

I have another function, which uses it and it refreshes the iframe. I want to get the data from the URL and add another with it if some of these data exist. Firebug shows me, that search is not defined, but why?

function RefreshIFrames(MyParameter) {
    var cat = window.params.cat;
    var category = window.params.category;
    var search = window.params.search;

    if (search.length>0 && category.length>0){
        window.location.href="http://siriusradio.hu/kiskunfelegyhaza/video/index.php?search="+search+"&category="+category+"&rendez="+MyParameter;
    }

    if (cat.length>0){
        window.location.href="http://siriusradio.hu/kiskunfelegyhaza/video/index.php?cat="+cat+"&rendez="+MyParameter;
    }

    if (cat.length==0 && category.length==0 && search.length==0){
        window.location.href="http://siriusradio.hu/kiskunfelegyhaza/video/index.php?rendez="+MyParameter;
    }
    alert(window.location);
}
  • 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-13T02:05:41+00:00Added an answer on June 13, 2026 at 2:05 am

    If you want to add rendez OR change the existing rendez, do this – I am assuming the URL is actually beginning with http://siriusradio.hu/kiskunfelegyhaza/video/index.php so no need to create it. Let me know if you need a different URL than the one you come in with

    The parameter snippet did not work proper (for in should not be used on a normal array)

    Here is tested code

    • DEMO
    • DEMO WITH DROPDOWN
    function getParams(passedloc){
      var params = {}, loc = passedloc || document.URL;
      loc = loc.split('?')[1];
      if (loc) {
        var param_array = loc.split('&');
        for(var x,i=0,n=param_array.length;i<n; i++) {
          x = param_array[i].split('=');
          params[x[0]] = x[1];
        }
      }
      return params;
    };
    
    function RefreshIFrames(MyParameter,passedloc) { // if second parm is specified it will take that 
      var loc = passedloc || document.URL; // 
      window.param = getParams(loc); 
      loc = loc.split("?")[0]+"?"; // will work with our without the ? in the URL
      for (var parm in window.param) {
        if (parm != "rendez") loc += parm +"="+ window.param[parm]+"&";
      }
      // here we have a URL without rendez but with all other parameters if there
      // the URL will have a trailing ? or & depending on existence of parameters
      loc += "rendez="+MyParameter;
      window.console && console.log(loc)
      // the next statement will change the URL
      // change window.location to window.frames[0].location to change an iFrame
      window.location = loc; 
    }
    
    // the second parameter is only if you want to change the URL of the page you are in
    RefreshIFrames("rendez1","http://siriusradio.hu/kiskunfelegyhaza/video/index.php?cat=cat1&search=search1");
    RefreshIFrames("rendez2","http://siriusradio.hu/kiskunfelegyhaza/video/index.php?search=search2");
    RefreshIFrames("rendez3","http://siriusradio.hu/kiskunfelegyhaza/video/index.php?rendez=xxx&search=search2");
    RefreshIFrames("rendez4","http://siriusradio.hu/kiskunfelegyhaza/video/index.php");
    
    // here is how I expect you want to call it    
    RefreshIFrames("rendez5"​); // will add or change rendez=... in the url of the current page
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I found this script: <script language=Javascript TYPE=text/javascript> var container = document.getElementById('dl'); var seconds =
I found this script that gives you the username in Windows, but I get
I found this script attached to a modified index page. This looks like some
Hi i'm building a webapp. To remove the onclick delay i found this script
I've found this login script and I'm trying to implement it into my website
I found this random page script which is in PHP file. I'm a bit
I found this RGB to HSL script over at http://www.mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript . I can't find
I have found and customized this JQuery script, which displays different content when different
I wanted to use groovy for a little ftp script and found this post
I'm a PHP novice, and I recently found this database-free pagination script on a

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.