2

I have a dynamically changing variable from hash with a joint of a json path.

Example:

$(function() {
    $(window).bind( 'hashchange', function() {
        var hash = window.location.hash.substring(1);
        $("#display_content").html(position.hash);
    });
    $(window).trigger( 'hashchange' );
});

How is it posible to turn the hash variable into a joint of the json url?


Edit:

By joint i mean a part of a json url: (position.secondposition.content) so each part seperated by a . is a joint.

1
  • 1
    Please elabrote hash variable into a joint of the json url Commented Nov 17, 2013 at 15:41

1 Answer 1

3

You can use position[hash]

So change your code as

 $("#display_content").html(position[hash]);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.