Solved

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

Posted on 2012-04-05
3
353 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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…

737 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