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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:38:14+00:00 2026-06-05T17:38:14+00:00

Hope you all are fine and rocking your code editors. My question is how

  • 0

Hope you all are fine and rocking your code editors.

My question is how to pass url rel to a new page to use it in future?

Let me give you an example that will work better than 1000 words.

On page “A” I have url to page “B”, to load page “B” html I pointing that url straight to page “B” as <a href="page-B.html" rel="{{id}}">{{deptName}}</a> (don’t look at {{}} it is Mustache.js tags).

So when I am clicking on that link it is working as it should, pointing me to page “B” and loading my new html layout (that is different from page “A”).

Now because I am fetching data from JSON I need to pass rel="{{id}}" to a page-B to tell what data I want from the JSON.

Any good ideas or practical code how you do that?

Thank you!

P.S.

On page “B” in $.delegate I need that id to do something like that:

$.ajax({
        beforeSend: function() { $.mobile.showPageLoadingMsg() }, //Show spinner
        complete: function() { $.mobile.hidePageLoadingMsg() }, //Hide spinner
        url: 'http://website.com/categoryJSON.ashx?&catId=THE_ID&callback=?',
        dataType: 'json',
        success: function(data) {
            var template = $('#pageCategoryTpl').html();
            var html = Mustache.to_html(template, data);
            $('[data-role=content]:first').html(html);
        }
    });
  • 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-05T17:38:18+00:00Added an answer on June 5, 2026 at 5:38 pm

    I found a simple solution and it is window.sessionStorage.

    In my particular case scenarion I am clicking on URL/link, getting href (this where my id is), saving that with window.sessionStorage, changing window.location to the new page and do my JSON magic.

    The code:

    On page “A”:

    $('a').live('click', function(){
    
            var currentID = $(this).attr('href');
    
            window.sessionStorage.setItem('parentId', currentID);
    
            window.location = 'page-B.html';
    
            return false;
    
            });
    

    On page “B”:

    var parentId = sessionStorage.getItem('parentId');
    
    $.ajax({
     url: 'http://www.url.com/file.json?id=' + parentId + '',
     dataType: 'json',
     success: function(data) {
        alert('Success!');
     }
    });
    

    Vuala! Hope that will help someone.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hope You all are fine and also in one of your best of moods!!
hope you all are fine and also in one of your best of moods!!
Hope you all will be fine. The scenerio is that i have a page
Hope you're having a good Friday and stuff... okay, so here's my question: All
First of all, I am new to WPF and Xaml, so I just hope
Hope you all fine.I am facing some sort of problem while passing multiple parameters
Hope you all will be fine. The scenerio is I have a form on
Hope you all will be fine. Actually i want to upload image files from
I hope you are all fine. I would like to ask the expert php
Hope you all are fine. I need to make a query. Kindly help me

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.