Solved

jquery read post data from url in a .load on the called page.

Posted on 2012-04-05
3
352 Views
Last Modified: 2012-04-09
I am performing a

 $.('#mycontainer').load('myurl.html?id=123');

on the myurl.html when I try to read the location.href, it is showing me the index.html(parent container) url.

I need to be able to read the id param from the url on the myurl.html page to determine what I need to do as it can change based on certain things.

At the end, the question is how do I read the url param from the page that was called in?

Thanks

Judson
0
Comment
Question by:judsonmusic
  • 2
3 Comments
 
LVL 20

Accepted Solution

by:
Proculopsis earned 500 total points
ID: 37812347
This will work if #mycontainer is an iframe, otherwise myurl.html will have no context of its own as it's content will just be in-line within the hosting page, as you have seen.
0
 
LVL 3

Author Comment

by:judsonmusic
ID: 37812360
Thats what I was afraid of. I can do this with coldfusion or anther server language no problem but am trying to figure out a way to manipulate data without using a server side language.

I could easily grab the attribute like id=1, or id=2 and then set my url accordingly. but I want to have code blocks instead. maybe I can show hide onsuccess based on the id?
0
 
LVL 20

Expert Comment

by:Proculopsis
ID: 37815123
I'm guessing the content being loaded is static but if you can change myurl.html to myurl.cfm then you will unlock all the information you need.  Or you could use some kind of proxy - loader.cfm?content=myurl.html&id=123' and get it to include the content.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Provide the IDEA of External JS 1 34
Accordion won't close correctly 5 12
Session on Html 8 36
Ajax on ASP 2 31
This article discusses how to create an extensible mechanism for linked drop downs.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

680 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question