Adding A URL PARAMETER TO AJAX

Please i'm wondering if anyone could help me embedding a url parameter to an ajax linkk. here's my code
$('#read').load('sources/news_read.asp?news_id=<%=news_id%>');
the problem is i can't create a recordset on html page and dats creating the problem

And Spry version where the URL is myfile.html?file=employees
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<script src="SpryAssets/xpath.js"></script>
<script src="SpryAssets/SpryData.js"></script>
<script src="SpryAssets/SpryURLUtils.js"></script>
<link href="SpryAssets/SpryMasterDetail.css" rel="stylesheet">
<script type="text/javascript">
var params = Spry.Utils.getLocationParamsAsObject();
var ds1 = new Spry.Data.XMLDataSet(params.file+".xml", "employees/employee");
</script>
<body>
<div class="MasterDetail">
  <div spry:region="ds1" class="MasterContainer">
    <div class="MasterColumn" spry:repeat="ds1" spry:setrow="ds1" spry:hover="MasterColumnHover" spry:select="MasterColumnSelected">{firstname}<br />
    {lastname}</div>
  </div>
  <div spry:detailregion="ds1" class="DetailContainer">
    <div class="DetailColumn">{firstname}</div>
    <div class="DetailColumn">{lastname}</div>
    <div class="DetailColumn">{joinDate}</div>
  </div>
  <br style="clear:both" />
</div>
</body>
</html>
The URL parameters can be adjusted to suit.
Gramps

Similar Messages

  • Adding a URL parameter to the path to spry XMLdataset

    anyone know an easy way to code this one.
    I can pull in xml and do what ever I want with it, but I want to pull in an XML page that is generated with the URL parameters of the current page
    so  instead of
    var ds1 = new Spry.Data.XMLDataSet("my_XML.php", "export/row",{useCache:false,loadInterval:2000});
    i'd like the url to include the params of the current page
    in php something like "my_XML.php?jobnumber=".$var1."&version=".$var2 ;
    where var1 and var2 are URL params of the current page URL
    I'm guessing I need to create the javascript equivalent to var ds1 = new Spry.Data.XMLDataSet("my_XML.php",  etc
    but I've got no idea what that might be
    anyone help??

    And Spry version where the URL is myfile.html?file=employees
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Untitled Document</title>
    <script src="SpryAssets/xpath.js"></script>
    <script src="SpryAssets/SpryData.js"></script>
    <script src="SpryAssets/SpryURLUtils.js"></script>
    <link href="SpryAssets/SpryMasterDetail.css" rel="stylesheet">
    <script type="text/javascript">
    var params = Spry.Utils.getLocationParamsAsObject();
    var ds1 = new Spry.Data.XMLDataSet(params.file+".xml", "employees/employee");
    </script>
    <body>
    <div class="MasterDetail">
      <div spry:region="ds1" class="MasterContainer">
        <div class="MasterColumn" spry:repeat="ds1" spry:setrow="ds1" spry:hover="MasterColumnHover" spry:select="MasterColumnSelected">{firstname}<br />
        {lastname}</div>
      </div>
      <div spry:detailregion="ds1" class="DetailContainer">
        <div class="DetailColumn">{firstname}</div>
        <div class="DetailColumn">{lastname}</div>
        <div class="DetailColumn">{joinDate}</div>
      </div>
      <br style="clear:both" />
    </div>
    </body>
    </html>
    The URL parameters can be adjusted to suit.
    Gramps

  • 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

  • How to catch URL parameter from Portal URL in Web Dynpro iView

    Hi All,
    I have a web dynpro application running as a portal iView successfully. Now the client wants to make it internationalized with 7 languages. Currently they access the portal - and via role assignment they get to the portal tab with the wd iView. Now they want to send a parameter for the language key with the portal URL. So when they are typing in http://myportal.mydomain.com now they want to type in http://myportal.mydomain.com?sap-locale=de or so. My question is how can I catch this parameter in the WD application when it is running inside a portal iView? Is it at all possible?
    I have written a very small application which is trying to catch a URL parameter named PARAM. The code I have written is the default one as below:
    String paramValue = WDWebContextAdapter.getWebContextAdapter().getRequestParameter("PARAM");
    When I run the application standalone and add the PARAM=something in last of the URL I can catch it. But when I create an iView and while previewing it I add the same PARAM value it is coming as null all the time. Same when I add this iView to a role and show it via role assignment in protal. Please help to let me know how to achieve this. I think if I can read the parameter value from Portal URL in the WD iView - then I can set it as the default locale of the application and then show language specific file to achieve internationalization.
    Your urgent help will be highly appreciated.
    Warm Regards,
    Shubho

    Hi Shubhadip
    Even if you get the parameters, how do you internationalize your application? Are you not following the standard way as described in the following link. In this case you never need to capture any such parameter. This is done by the WD runtime automatically .
    <a href="http://help.sap.com/saphelp_erp2005/helpdata/en/f4/d95664da179b4db731e21c2e470b72/frameset.htm">Internationalization of WD projects</a>
    You can retrieve application parameters specified at the creation of iview by "adding parameters(with the same name as in iview application parameters) to the default plug of the Component Interface View of the WD application". "onDefaultPlug" method of the interface view controller you get these values as parameters, which you can save in the context node of component controller for later use.This is guaranteed to work.
    But again this is not what you want exactly. You want the user to specify the value at runtime. If you have just 7 languages, you can create 7 set of iviews with different application parameter value indicating language key, and assign to 7 different set of roles, each representing one set of users with common language.
    I hope you find a solution.
    Regards
    kk

  • ABAP -WebDynpro - Read URL Parameter

    Hi,
    We have a Custom 'Catalog' that needs to be called from SRM using OCI (Open Catalog Interface). We are developing this custom catalog using ABAP Web Dynpro. We have following issues because of which we are unable to communicate back to Shopping cart from the Custom Catalog:
    1. Unable to read the value of 'HOOK_URL' in WebDynpro application. We need this value so that it can be used as Exit URL. How and where do we read this URL parameter in ABAP WebDynpro ?
    2. How can we return the 'HTML Form' to SRM with the values from Custom Catalog to fill the shopping cart ?
    I would appreciate your help...
    Thanks
    Meenal

    Hi Menal,
    I had the same problem.
    Did you define the HOOK_URL parameter in your webservice ? If not, do this 1st.
    2nd
    In you Webdynpro read the HOOK_URL in your handledefault method your window. Store it e.g. as attrribute in you assistance class.
    method handledefault .
    *&- Add FOF and HOOK_URL to assistanceclass attributes
      wd_assist->hook_url = hook_url.
    endmethod.
    After this you can read your HOOK_URL e.g in a view via:
    concatenate 'HOOK_URL=' wd_assist->hook_url zlv_hook_url into zlv_hook_url
    I hope your question is answered.
    What I want to now is: How to controll the HOOK_URL so that the formfields of the extenal catalog is added to the shopping card. Do you now that ?
    John

  • How to open URL IView with dynamic url parameter (navigate_absolute)

    Hi Experts,
    i would like to open an URL-IView from the WebDynpro ABAP Application in the Enterprise Portal 7.0
    and i want to set the URL parameter dynamically. Is this possible and how can i achieve this!!
    Thx Markus

    Hi Markus,
    You can take help of the following code snippet.
    Here we are calling an Iview using absolute navigation and passing URL parameters as well
    * Select the input value entered and then pass it to REM INQ application---------
      DATA lv_inputbusobjid   TYPE          wd_this->Element_context-inputbusobjid.
      DATA lv_path            TYPE          string.
      DATA lv_tab_wd_param     TYPE          wdy_key_value_list.
      DATA lv_str_wd_param     TYPE          wdy_key_value.
      DATA lo_el_context      TYPE REF TO   if_wd_context_element.
      DATA api_component      TYPE REF TO   if_wd_component.
      DATA window_manager     TYPE REF TO   if_wd_window_manager.
      DATA window             TYPE REF TO   if_wd_window.
      DATA lo_api_component   TYPE REF TO   if_wd_component.
      DATA lo_portal_manager  TYPE REF TO   if_wd_portal_integration.
    * read the imput data first-------------
    * get element via lead selection
      lo_el_context = wd_context->get_element( ).
    * get single attribute
      lo_el_context->get_attribute(
        EXPORTING
          name =  `INPUTBUSOBJID`
        IMPORTING
          value = lv_inputbusobjid ).
    ** call remuneration inquiry window using absolute navigation
      CLEAR lv_tab_wd_param.
    * Adding parameters
      lv_str_wd_param-key = 'sap-wd-configId'.
      lv_str_wd_param-value = 'CACS_REMINQ_CONF'.
      APPEND lv_str_wd_param TO lv_tab_wd_param.
      lv_str_wd_param-key = 'BUSOBJ_ID'.
      lv_str_wd_param-value = lv_inputbusobjid.
      APPEND lv_str_wd_param TO lv_tab_wd_param.
      lo_api_component = wd_comp_controller->wd_get_api( ).
      lo_portal_manager = lo_api_component->get_portal_manager( ).
      if lo_portal_manager is BOUND.
    * PCD
      lv_path = 'ROLES://portal_content/com.sap.pct/specialist/com.sap.pct.erp.common.workset_reuse/com.sap.pct.erp.icmparticip.bp_folder/com.sap.pct.erp.icmparticip.15.bp_folder/com.sap.pct.erp.icmparticip.15.pages/com.sap.pct.erp.icmparticip.RemInquiry'.
      lo_portal_manager->navigate_absolute(
        navigation_target   = lv_path
        navigation_mode     = if_wd_portal_integration=>co_show_external
        window_features     = 'toolbar=no,resizable=yes,scrollbars=yes'
        business_parameters = lv_tab_wd_param
      endif.
    Hope this helps
    Regards
    Manas Dua

  • Reading URL Parameter

    Dear Experts
    I have created a webdynpro ivew, and added a Quick link to it and added to the workset. So that I can acccess the ivews form URL. I need to pass the URL paramenter also
    like
    http://<Server Name>:<portNumber>/irj/portal/Quick link?param1=Value, Now I need to read the param1 value in my Webdynpro code.
    When i set the value in Application parameter I was able to get the value using the following code
    path=WDProtocolAdapter.getProtocolAdapter().getRequestObject().getParameter("path");
    My Question in how to get the value which is given in URL parameter
    Regards
    Noel

    Hi
    I think the code that you mentioned should works. I observe one thing that in getParameter you mentioned path as an argument. You need to mention the application parameter name.
    Also, if you run the webdynpro application standalone you will not get its iView application parameter. You should only run the iView in portal or in preview mode to get the desired value.
    Following code can help you in listing down all the application parameters that a webdynpro iview can contain. If you mentioned your parameter it will display the same too:
              Enumeration enum =
                   WDProtocolAdapter
                        .getProtocolAdapter()
                        .getRequestObject()
                        .getParameterNames();
              for (Enumeration e = enum; e.hasMoreElements();) {
                   wdComponentAPI.getMessageManager().reportSuccess(
                        "iView Params::" + e.nextElement());
    Coming back to your problem, suppose you have application parameter set as ivuParam  then you can get its value as
              String ivuParam =
                   WDProtocolAdapter
                        .getProtocolAdapter()
                        .getRequestObject()
                        .getParameter(
                        "ivuParam");
    Hope this helps.
    Abhinav

  • Passing custom URL parameter to a FPM app

    Hello,
    I am facing a problem when trying to pass an URL parameter to a GAF FPM application.
    The standard way by adding a parameter to the WD application and adding a parameter to the default plug in the window doesn't work for FPM... at least in my case.
    Does anyone know how URL parameters work with the FPM framework?
    Thank you and BR,
    Chris

    You just need to declare parameters which you will be using in WD Application - Parameters tab.
    To fetch parameters for application which is using FPM, you have to use following piece of code -
        wd_this->app_param = wd_this->mr_fpm->mo_app_parameter.
        CALL METHOD wd_this->app_param->get_value
          EXPORTING
            iv_key   = 'INTERFACE_MODEL'
          IMPORTING
            ev_value = wd_this->lv_interface_model.
        CALL METHOD wd_this->app_param->get_value
          EXPORTING
            iv_key   = 'MODE'
          IMPORTING
            ev_value = wd_this->lv_mode.
    Here wd_this->mr_fpm holds FPM reference and is of type ref to IF_FPM
    and wd_this->app_param holds FPM parameters reference and is of type IF_FPM_PARAMETER.
    After getting reference I'm calling methods to get individual application parameters by sending their names.
    We called this in DOINIT of component controller.
    Regards
    Manas Dua

  • CFSWITCH of a URL Parameter

    In the attached code, the CFQUERY inside the first CFCASE was
    working fine (without using
    URL.do) before I added the CFSWITCH. But now the switch
    statement always falls to the default case (regardless of what
    URL.do is), and I have no idea why. And the URL parameter
    itself (given in the
    FORM ACTION attribute) has no typos in it in either case.
    Could I get some help with this? Thanks!

    Oh! Yes, that's the correct behavior... I guess I'm still
    getting use to the pound signs. PHP goes the opposite route to
    accommodate both literal values and variables inside the output
    tags, requiring explicit quotes for literals rather than explicit
    hashes for variables.
    Anyway, thanks!

  • Missing URL parameter: IterationId

    Error:  Missing URL parameter: IterationId
    I get this error when I add a footer to my report.  Is there a fix?
    Report viewer 2010
    Visual Studio 2008 sp 1
    .Net 3.5
    Browser = firefox, have not tried ie.
    IIS = whatever ships with Windows 7 prof.
    Thanks,
    Sam

    (Apologies for bumping this old, old thread; it was the first hit in Google when searching for this problem myself, so I thought I'd post how I resolved my issue in case others stumble upon it.)
    Are you sure this is just from adding a footer?  I was getting this error message myself, and it was due to the Line control.  For whatever reason, the Line control tries to include a standard blank image right after it, but the URL is missing
    that parameter in FireFox and Chrome (but not IE, as far as I can tell). When I remove all the Line controls, the error goes away.  Make sure you don't have any Lines in your footer (or anywhere else on your report, for that matter.)

  • How to change the fields in a JSF form based on a URL parameter

    I am trying to build a generic JSF form of parameters which I want to dynamically change (i.e.
    change which field is visible, what the label text should be, etc) based on a URL parameter.
    I can set the fields using logic in the backing bean as an action on a command button pressed.
    But how do I do it based on the URL parameter ? I can retrieve the URL parameter but I
    don't know where to put (or hook) the Java code to do this initialization prior to
    the page being rendered for the first time.
    The fields in the JSF is being configured dynamically using a database table.
    BTW I am using Jdeveloper 10.1.3.5
    Thanks
    CK

    Thanks. I decided to set a Session bean to store the value of the URL parameter (if it is set)
    and then to use the session bean to initialize the attributes of the fields on the JSF Page.
    There also seems to be some caching of the inputText fields (i.e. it reverts back to the first
    initialized value) even though I tried to change it using the URL parameter in the requestScope
    backing bean. So, setting the values into the Session bean and retrieving it back from there
    seems to be more reliable.

  • How can I pass URL parameter value to text field?

    Dear Masters,
    I have a text field. I want it to have a value based on the URL parameter, for example:
    http://myapplication.net:7777/pls/apex/f?p=102:1:::::P1_RTNUM:9448,P1_EMAILADD:email.add.here
    I want the value of the text field = P1_EMAILADD after the form was loaded. Also, please have it read-only.
    Thanks a lot.
    Edited by: user6368519 on Sep 16, 2009 11:39 PM

    Thanks Saad,
    Can I email you(I would need your email) for any concerns or just create a new thread for you to look?
    This is ok now. I'm sorry but I just marked this one as an "answered" one last time.
    Thanks for all the help again I appreciate it. ;)
    Thanks,
    Aaron
    [email protected]

  • How can I pass empty value in URL Parameter

    Hi,
    I am passing different URL parameters to one page, to filter
    the recordset on that page. How can I pass an empty value in the
    URL parameter so that the recordset in unfiltered?
    The URL parameter is based on one field of the database:
    ContentType. So, the link would be to
    default.asp?ContentType=Event
    and then all records that have the ContentType field in the
    DB as Event are displayed. Is it possible to use this system to
    pass an empty parameter so that all records are displayed?
    Thanks
    Ian

    ?ContentType=All
    <% if (ContentType == "All")
    Build recordset w/o filtering
    ASP is rusty, but those are the basics.
    "iandobie" <[email protected]> wrote in
    message
    news:e8im80$q7m$[email protected]..
    > Hi,
    > I am passing different URL parameters to one page, to
    filter the recordset
    > on
    > that page. How can I pass an empty value in the URL
    parameter so that the
    > recordset in unfiltered?
    > The URL parameter is based on one field of the database:
    ContentType. So,
    > the
    > link would be to
    > default.asp?ContentType=Event
    > and then all records that have the ContentType field in
    the DB as Event
    > are
    > displayed. Is it possible to use this system to pass an
    empty parameter so
    > that
    > all records are displayed?
    > Thanks
    > Ian
    >

  • How can I add a url parameter to choose the right database row to delete using php in Dreamweaver CC

    Hi all,
    I have just upgraded to Adobe Creative Cloup.  Though I find it very good there was one flaw and that was the omision of the database section.  I got this sorted but now I find that once I have set up the connection to the database and want to eithger delete or update records there is no 'url parameter' button to do so.  Can someone advise we how to get round this.
    Seasons Greatings from
    David J

    The link will look similar to
    myPage.php?ID=myVariable

  • How to pass mysql query id through url parameter to a detail page

    Hi there,
    I am a newbie to JSP and I am trying to pass a url parameter to a detail page so that it will query a mysql data query to show the details of that query. How can I write the query on the details page so that it will display the query results on the page. eg select * From data Where = "passed_url parameter_ value". Please i need urgent help on this please.

    <Acknowledged>
    which should be strongly cautioned against even for "newbies".
    </Acknowledged>
    Right, but the code you posted will "work" in a very harmful wayNot always, I used normal Statements last year and I had no problems.
    Even with pretty capible code brakers trying to cause $h!t with my application.
    Just check for invalid datatypes, and for SQL Injections remove stuff like ' or replace with `
    But yes PStat... are the better way.

Maybe you are looking for