/    Sign up×
Community /Pin to ProfileBookmark

query string manipulation

Hi,

is there a way to manipulate the query string appended to a URL without reloading the whole page?
If so, how do I have to do it?

Thanks,
Toby

to post a comment
HTML

5 Comments(s)

Copy linkTweet thisAlerts:
@VladdySep 29.2004 — Should do in most cases:
[CODE] function obj_queryString()
{
qs=document.URL.substring(document.URL.indexOf('?')+1,document.URL.length);
queries=qs.split(/&/);
for(i=0;i<queries.length;i++)
{ query=queries[i].split(/=/);
this[query[0]]=unescape(query[1]);
}
}
queryString=new obj_queryString();[/CODE]
Copy linkTweet thisAlerts:
@sir_tobyauthorSep 29.2004 — As far as I understand it, your code produces an array containing the parameters transferred via the query string, right?

What I meant is something different:

By using the query string I try to supply information about which page should be loaded in the content frame of a frameset. But, after the frameset and the correct content is loaded, the URL remains the same even if the user performs some navigation. When bookmarking the site afterwards he´ll always return to the page he came on first (at least I think so)...

I know there are problems with bookmarking pages within framesets, but I think there must be a solution to at least having the users come back to the start page of the site. Therefore I´d like to clear the query string in the URL after the site has loaded so when they bookmark, it´s only the "main" URL that is saved. Okay?

The query string thing is just meant to be an option to post links to a specific page of the site and direct the users there without having them click their way through themselves...

But thanks anyway!

Toby
Copy linkTweet thisAlerts:
@VladdySep 29.2004 — Sorry, have not been using frames since last century.... neither should you
Copy linkTweet thisAlerts:
@sir_tobyauthorSep 30.2004 — Ok, so which possibilities do I have to do it better (the thing is I cannot use server-side scripting here)?

These are the requirements that, in their combination, make it difficult, at least for me:

  • - I need some areas of the window to remain fixed and non-scrollable so they stay in view

  • - I don´t want to have the whole site´s content in hidden div´s within one single html document (because it´s unpractical to load and to maintain)

  • - I cannot put the main content in fixed-size boxes of any kind because it has to adapt to the user´s window/screen size

  • - I have to provide a possibility to link to individual pages of the site from outside

  • - I want to be able to use the browser´s bookmark functionality (users needn´t be turned to the exact subpage but at least to the start page of the site)


  • Which possibilities are there for importing external content if not loading it into frames or iframes?

    Cheers,

    Toby
    Copy linkTweet thisAlerts:
    @VladdySep 30.2004 — [i]Originally posted by sir_toby [/i]

    [B]Ok, so which possibilities do I have to do it better (the thing is I cannot use server-side scripting here)?[/b][/quote]

    Nowadays pretty much every web hosting service offers server side scripting capabilities. Why are you imposing masochistic restrictions upon yourself ? :rolleyes:
    [b]

    - I need some areas of the window to remain fixed and non-scrollable so they stay in view[/b]
    [/quote]

    Why? Your visitors certainly do not need to stare at your banner all the time - they would rather have this real estate to your content. Navigation (when left at the top of the page) is also a "Home" key away. Much better than having it inaccessible or ending up with confusing mess of scroll bars when the browser window size is smaller than the "fixed" content of your page
    [b]

    - I don´t want to have the whole site´s content in hidden div´s within one single html document (because it´s unpractical to load and to maintain)[/b]
    [/quote]

    Yeah, there is anchor element...
    [b]

    - I cannot put the main content in fixed-size boxes of any kind because it has to adapt to the user´s window/screen size

    [/b]
    [/quote]

    But what makes you think you can do it to your banner and navigation? (see above)
    [b]

    - I have to provide a possibility to link to individual pages of the site from outside[/b]
    [/quote]

    That is why frames are not included in the current HTML specification
    [b]

    - I want to be able to use the browser´s bookmark functionality (users needn´t be turned to the exact subpage but at least to the start page of the site)[/b]
    [/quote]

    That is why frames are not included in the current HTML specification
    [b]

    Which possibilities are there for importing external content if not loading it into frames or iframes?



    Cheers,

    Toby [/B]
    [/QUOTE]

    "External" content usually refers to that outside your domain, and for that <object> element is acceptable. In your case, however, that is "internal" content you are talking about. How you organize it, is up to you, but whatever "importing" you want to do has to be done server side.
    ×

    Success!

    Help @sir_toby spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.19,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...