?
Solved

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

Posted on 2012-04-05
3
Medium Priority
?
357 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 2000 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer…
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
The viewer will learn how to dynamically set the form action using jQuery.
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)

770 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