Calling a page with ajax based on url parameter

please can anyone help me with this problem that i've encountered. i'm able to capture a url parameter with javascript and i want to add it to my jquery code which calls a page in a div  but i'm able to do it. here's my code:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
<script language="javascript" type="text/javascript">
function urlink()
var tlink = window.location.search.substring(1)
jQuery(function($){
    $('#mydiv').load('real_news.asp?'+ urllink());
</script>

Your jquery is trying to add data by calling a function. Also, you're just getting the value of the parameter. There's not a key to trigger anything on your server-side script. Make sure real_news.asp is processing correctly, looking for key (some-key) AND value (tlink). You might want to simply try concatenating the value of the var like this though:
<script>
var tlink = window.location.search.substring(1);
$('document').ready(function() {
$("#mydiv").load("real_news.asp?some-key=" + tlink);
</script>
Another way you could do it is use server side scripting to look and see if the URL-PARAM is set and if it is then echo value of URL-PARAM into load() method. php example below. I'm sure you can find an asp equivalent to achieve the same result. I think the key (pun) to this problem is that you do not have a key to associate the value with in order to process anything.
<script>
<?php if (isset($_GET['URL-PARAM'])) { ?>
$('document').ready(function() {
$("#mydiv").load("real_news.asp?some-key=<?php echo $_GET['URL-PARAM']; ?>");
<?php }else{ ?>
alert ("there is no ?URL-PARAM=something in the URL!!!");
<?php } ?>
</script>
best,
Shocker

Similar Messages

  • Call OAF page with post parameters

    Hi,
    From a custom OAF payment screen, on button click, I'm opening a third party website in the same window.
    Once payment is done, third party will send me conf num back as the background process (user is still in third party website).
    For this post back purpose, I have created a simple OAF page and given the OAF url to third party.
    https://xxx-dev:85/OA_HTML/OA.jsp?page=/xxx/oracle/apps/xx/webui/PostbackPG&confNum=
    However, third party refused to use this url as it is a html get. They send return values (conf num) only by html post as security measure.
    Is it possible to use OAF page to get post requests? If yes, please let me know how to call OAF page with a post and how to get values in PR of CO.
    Thanks
    Prabhu

    Any ideas please!

  • How to call html page with in the flash

    I am new to action script, can some one guide me how to call html page with in the flash. lets say i have movie clip having instance name as "news_feed", I need to disply the html page in this news_feed. kindly help me, thanks alot

    some one tell me, weather it is possible or not ??

  • Calling a page with flow logic from a controller

    Is there any possibility of calling a page with flow logic(x.htm ) from a controller?
    Also I want to know how to apply scrolling to a tableview  in a View as there is no event handler here. Iam able to view the first 30 records but want to navigate from 31 to 60...61to 90 and so on.......
    Thanks and regards,
    Sinu

    Thank you so much...
    but will I be able to call from a controller as we call  a view...similar to the below code.
    lref_first_view = create_view( view_name = 'first.htm' ).
    lref_first_view->set_attribute( name = 'MODEL' value =           mref_model_first ).
    call_view( lref_first_view ).
    I have already set the visibleRowCount....but my issue is to navigate to the next records i.e say 2nd page 3rd page..........
    Regards,
    Sinu

  • Decision based on URL Parameter

    Hi,
    I want to make a decision in the GP based on URL Parameter.
    I have an application with url that has the ID in the url address and takes out the data from the DB based on the ID if there is no ID then this is a new Form.
    If this is a new Form (no ID in URL) I need to call Application A and then B and then send mail and so on...
    If this is an saved Form (with ID in the URL) I need to call Application B and then send mail and so on...
    I tried to do it with Decision (predefined value) but no luck.
    Any suggestion?
    Regards,
    Silvy

    Try implementing that logic into a PhaseListener and see which phase suits you best.

  • Hpw tp call a 'Page with Flow Logic' from within a View

    Within the same BSP, I have the requirment to call a page in the ;Page with Flow Logic' section from a page in the 'View' section.   
    Is this possible and if it is, how do I do it?  I have tried some calls but they all have failed.
    Thanks
    Glenn

    in the view you want to navigate then try
    <bsp: call > or <bsp: goto>  htmlb tags. or else you can use window.open method and open in a new window.

  • How to create search engine in JSF page with AJAX

    I want to create Java Server Faces page with search engine using AJAX. I'm interested can I do this with PL/SQL statement which searches strings into all Oracle tables at database level? What are the best practices in this case?

    user10484841 wrote:
    I want to create Java Server Faces page with search engine using AJAX.
    I'm interested can I do this with PL/SQL statement which searches strings into all Oracle tables at database level? I give up.
    Can you?
    What are the best practices in this case?Best practice is to know where data is stored to avoid search of all Oracle tables.

  • Cannot create dynamic page with cursor based on linked table

    I get the following error when i try to create a dynamic portal page that uses a pl/sql cursor:
    ORA-06550: line 1, column 24:
    PL/SQL: ORA-00980: synonym translation is no longer valid
    ORA-06550: line 1, column 24:
    PL/SQL: SQL Statement ignored (WWV-11230)
    Failed to parse as REPORTS - DECLARE CURSOR C1 IS SELECT * FROM
    [email protected]; BEGIN FOR R1 IN C1 LOOP HTP.P(','||'<BR>');
    END LOOP; END; (WWV-08300)
    Dynamic page:
    <HTML>
    <HEAD>
    <TITLE>Example</TITLE>
    </HEAD>
    <BODY>
    <H2>Example of A Dynamic Page</H2>
    <ORACLE>
    declare
    cursor c1 is
    select * from [email protected];
    begin
    for r1 in c1 loop
    htp.p('hello<br>');
    end loop;
    end;
    </ORACLE>
    </BODY>
    </HTML>
    When i use the sql query from the cursor in the page below, i get no errors:
    <HTML>
    <HEAD>
    <TITLE>Example</TITLE>
    </HEAD>
    <BODY>
    <H2>Example of A Dynamic Page</H2>
    <ORACLE>select * from [email protected]</ORACLE>
    </BODY>
    </HTML>
    I tried a dynamic page with a cursor on session_roles and had no problems. I assume that there is an issue with the database link or the privileges. The queries seem to get executed under portal_public;
    Oracle Portal Version: 9.0.4.0.99

    I get the following error when i try to create a dynamic portal page that uses a pl/sql cursor:
    ORA-06550: line 1, column 24:
    PL/SQL: ORA-00980: synonym translation is no longer valid
    ORA-06550: line 1, column 24:
    PL/SQL: SQL Statement ignored (WWV-11230)
    Failed to parse as REPORTS - DECLARE CURSOR C1 IS SELECT * FROM
    [email protected]; BEGIN FOR R1 IN C1 LOOP HTP.P(','||'<BR>');
    END LOOP; END; (WWV-08300)
    Dynamic page:
    <HTML>
    <HEAD>
    <TITLE>Example</TITLE>
    </HEAD>
    <BODY>
    <H2>Example of A Dynamic Page</H2>
    <ORACLE>
    declare
    cursor c1 is
    select * from [email protected];
    begin
    for r1 in c1 loop
    htp.p('hello<br>');
    end loop;
    end;
    </ORACLE>
    </BODY>
    </HTML>
    When i use the sql query from the cursor in the page below, i get no errors:
    <HTML>
    <HEAD>
    <TITLE>Example</TITLE>
    </HEAD>
    <BODY>
    <H2>Example of A Dynamic Page</H2>
    <ORACLE>select * from [email protected]</ORACLE>
    </BODY>
    </HTML>
    I tried a dynamic page with a cursor on session_roles and had no problems. I assume that there is an issue with the database link or the privileges. The queries seem to get executed under portal_public;
    Oracle Portal Version: 9.0.4.0.99

  • Calling CFC Method With AJAX

    Hello Guys , I am trying to call Component method using AJAX
    but its not working , Here is the Code i am using . In Code
    REC.OPEN is giving Trouble. Is this a Proper way to call Function ?
    function Process_Calendar(day,month,year,name){
    var hello = document.getElementById(name);
    hello.innerHTML = day+'<img
    src="../../Content/Graphics/images.jpg">';
    if (window.XMLHttpRequest)
    req = new XMLHttpRequest();
    else if (window.ActiveXObject){
    req = new ActiveXObject("Microsoft.XMLHTTP");
    req.open("getNoCache","BaseFunc.cfc?Method=Insertme&month="+month+"&day="+day+"&year="+ye ar+"&ms="+new
    Date().getTime(),true);
    req.send("");
    if ((req.readyState == 4) && (req.status == 200)){
    var arr = req.responseText;
    hello.innerHTML = arr;
    Thanks a Lot

    This might be a stupid question, but do you have the method's
    access set to
    remote? You are calling it via HTTP.
    Bryan Ashcraft (remove brain to reply)
    Web Application Developer
    Wright Medical Technologies, Inc.
    =============================
    Macromedia Certified Dreamweaver Developer
    Adobe Community Expert (DW) ::
    http://www.adobe.com/communities/experts/
    "flooker" <[email protected]> wrote in message
    news:e61jtu$o22$[email protected]..
    > Hello Guys , I am trying to call Component method using
    AJAX but its not
    > working , Here is the Code i am using . In Code REC.OPEN
    is giving
    > Trouble.
    >
    > function Process_Calendar(day,month,year,name){
    >
    > var hello = document.getElementById(name);
    > hello.innerHTML = day+'<img
    src="../../Content/Graphics/images.jpg">';
    >
    > if (window.XMLHttpRequest)
    > {
    >
    > req = new XMLHttpRequest();
    > }
    > else if (window.ActiveXObject){
    >
    > req = new ActiveXObject("Microsoft.XMLHTTP");
    >
    > }
    >
    >
    >
    >
    req.open("getNoCache","BaseFunc.cfc?Method=Insertme&month="+month+"&day="+day+
    > "&year="+year+"&ms="+new Date().getTime(),true);
    > req.send("");
    >
    > if ((req.readyState == 4) && (req.status ==
    200)){
    > var arr = req.responseText;
    > hello.innerHTML = arr;
    >
    > }
    > }
    >
    > Thanks a Lot
    >

  • Insert Text file based on URL Parameter

    Hello! I have been able to get data to load using PHP into my
    document. BUT - that is only data that is IN the URL. So, for
    example, the URL might be ...index.php?profile=123456789
    In that case I can make the customer ID appear in all the
    other URLs on the page.
    i.e. : <a href="page2.php?profile=<?php echo
    ("$profile"); ?>">Click Here</a>
    Today, I would like a section of code (probably in a text
    file) to load in the page based on a parameter in the URL.
    Something like a URL ...index.php?destination=Australia
    And then in the body would something like "load australia.txt
    file here".
    I know this is probably bigger than I am making it sound. But
    I don't know how to load a chunk of code inside another chunk of
    code.
    Any starting points would be much appreciated. Are there any
    built-in Dreamweaver CS3 features that do this?
    Jon

    The purpose is to enter an earnest money dollar amount (Real Estate Short Sale contracts), and based on the amount, a corresponding file with a copy of a check with the proper amount will be inserted into the file at page 16.  A button would be fine , but it needs to be on the earnest money deposit line (the look of the form may not be altered).  The earnest money amounts are $1,500, $2,000, $2,500, $3,000, $3,500, $4,000, $4,500 and $5,000.

  • Problems refreshing page with AJAX

    Hello,
    I have never used AJAX but today I decided to try it to improve my current implementation of a "processing" page that I use to display a waiting message and to check every 5 seconds if a response is available. If it is, the user is redirected to a "processing done" page.
    My previous implementation used the refresh tag provided by HTML in the "processing" page:
    <meta HTTP-EQUIV="Refresh" CONTENT="5; URL=<%=request.getContextPath()%>/main/CheckForResponse.do"/>
    Every 5 seconds a struts action is executed and the action itself will forward to the "processing done" page when a response is available.
    This solution works, however I don't like the refresh page effect, so I was trying to use AJAX instead. Now I put in the "processing" page the following script:
            function checkForResponse()
                var xmlHttp;
                try
                    // Firefox, Opera 8.0+, Safari
                    xmlHttp=new XMLHttpRequest();
                catch (e)
                    // Internet Explorer
                    try
                          xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
                    catch (e)
                        try
                            xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
                        catch (e)
                            alert("Your browser does not support AJAX!");
                            return false;
                xmlHttp.open("GET","<%=request.getContextPath()%>/main/CheckForResponse.do",true);
                xmlHttp.send(null);
            }and I have the following html body tag.
    <body onLoad="setInterval('checkForResponse()',5000);">
    The function executes correctly and the struts action is also executed. However the problem is that for some reason the action doesn't forward to the "processing done" page. It does actually, if I debug, but nothing happens, the "waiting" page keeps being displayed.
    Does anyone have an idea about what I could be doing wrong? any suggestion?
    Thanks a lot!!

    Did you define the call back function correctly? like===
    xmlhttp.onreadystatechange = handleHttpEvent;
    function handleHttpEvent(){
            if (xmlhttp.readyState == 4) {
                if (xmlhttp.status == 200) {
                    // GO TO PROCESSING END PAGE
                } else {
                    window.alert("ERROR");
        }Also, you might want to check the progress bar application
    in bpcatalog -> http://bpcatalog.dev.java.net

  • How do I log a support call for Pages with Apple?

    Hello,
    Sorry to have to ask this question here because I suspect it has been covered and I'm searching wrong. Anyway I'm on the Apple support site trying to log a call for some erratic behaviour when Pages tries to sync with iCloud. It seems that no matter what I end up having to enter the serial number of my hardware. Well first off this is a software issue and not a hardware issue - I've been to the Genius Bar and they believe it is Pages failing to sync with the iCloud. I have had both the iPad and the iPhone replaced during the issue and still the same problem. Secondly I have two devices affected by the same Pages behaviour
    Ok so after going around in circles for quite some time and becoming quite frustrated I thought I would come here for some sane suggestions. The first of which I fully expect to be an explanation of how to log a software support call Is there anyone out there who can advise me on how to log my issue please?
    Many thanks in advance,
    Andy

    Do what you did before and, in a second session, look at V$SESSION and other relevant dynamic performance views.

  • Calling a page with lookup arguments

    Hi
    I have a page (page A) that contains a number of fields. I know the value of 2 of the fields on page A and these two fields form a unique identifier to a record in the underlying table (but they are not the primary key). I want to call page A from page B passing in the two values and for page A to then lookup the whole record from the database and present it to the user ready for editing. Quite a simple thing but I am struggling, can any give me pointers on how to do this?
    Thanks
    Chris

    Hi Chris,
    If you are using a branch to navigate to Page A from Page B you can pass the values you know from Page B to Page A. Then one method you could use to populate the rest of the fields is to use PL/SQL onload process with a SELECT INTO Query, something like:
    SELECT
      column1,
      column2,
      column3,
    INTO
      :P1_ITEM1,
      :P1_ITEM2,
      :P1_ITEM3
    FROM
      mytable
    WHERE
      column1 = :P1_ITEM1
    AND
      column2 = :P1_ITEM2;Remember to have your source used set to "Only when current value in session state is null" else this method won't work.
    Hope this helps.
    Paul

  • Reading pages with associated images from URL

    Hello,
    I want to read a file through URL from my jsp.I am successful to do so.But the problem is I am not getting "Imgaes"(which are given relative path in the Page which is pointed by the URL).Do anybody have any idea how to get those images..
    Thanks.

    Here is the code for the Reading File
    <%!
    public void showPage(JspWriter out,HttpServletRequest request){
         try{
              URL url = new URL("http://www.clubi.ie/webserch/engines/lycos/display.htm");
              String o1 = url.getAuthority();
              System.out.println("Object got from getAuthority() = " + o1);
              System.out.println("URL object = " + url);
              URLConnection urlCon = url.openConnection();
              System.out.println("URLConnection object = " + urlCon);
              urlCon.connect();
              DataInputStream data = null;
              String line;
              StringBuffer buf = new StringBuffer();
              try {
              data = new DataInputStream(new BufferedInputStream(
                                  urlCon.getInputStream()));
              while ((line = data.readLine()) != null) {
                   //System.out.println(line);     
                   buf.append(line + "\n");
              out.println(buf.toString());
              data.close();
              catch (IOException e) {
              System.out.println("IO Error:" + e.getMessage());
         }catch(Exception e){
              System.out.println("Exception:"+e.toString());
    }//end method
              %>

  • Need - Search page with LOV based flexfield item as search criteria

    Our requirement is to make a flexfield item as search criteria.
    Flexfield is having 2 segments Applicaiton and Responsibility, where 2nd segment *(Responsibility) is dependent on 1st (Application).*
    Accordingly, an LOV must get displayed for each flex segment in the search panel.
    We tried to create a page having this flex (DFF) item as a search criteria, but cannot proceed to get results in results region - we tried to use both properties in the query region - resultsbasedSearch and autocustomizationCriteria:
    Any ideas how to make a search functionality having LOV based flexfield items in the search criteria?
    Any other suggestions regarding the solution are welcome.
    Thank you very much.
    Regards,
    May B.

    Hi,
    try a SQL query that uses bind variables as follows
    ... where column1 like '%:col1param%' and '%:column2%' like :col2param
    Then in the implementation (session facade) check for null values and add '%' in case a value is null.
    The query in EJB is defined in the entity
    Frank

Maybe you are looking for

  • Error while loading Data in HFM application through ODI

    Hello All, I am performing a integration from source(Flat file) to HFM application I have created a Integration to it and while loading the data i get the following error:- org.apache.bsf.BSFException: exception from Jython: Traceback (most recent ca

  • Odd problem with Acrobat 8

    Hi I am having what might be considered a strange issue with adobe acrobat 8. When I want to print multiple copies of a document that is several pages then the print queue reports it as being several pages but only one copy and will only print one co

  • Running java command from DOS prompt

    Hi, When I run java from the DOS prompt (NT) in any other location than the JDK bin directory, I get the following error: Error opening registry key 'Software\JavaSoft\Java Runtime Environment' My understanding is to be able to run this from anywhere

  • Runtime Control Creation

    Hi, I want to create Check-Boxes or Radio-Buttons on Forms at runtime while having certain conditions... How can I create those on Runtime? Any help will be appreciated. Thanks.

  • Camera records correct time, but fcpx shows different date....?

    So I just did a test clip from my sd card and opened the clip up in finder and the date for date created is correct. But if I open the clip up in the import window of fcpx, the content created date is like 8 hours early.....why is this happening????