Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6033359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:28:19+00:00 2026-05-23T05:28:19+00:00

how can I create something like below div using jquery? preferably using something similar

  • 0

how can I create something like below div using jquery? preferably using something similar to $(document.createElement('div')); or something faster apart from $("<div spry:region="myDs">{hostname}</div>");

<div spry:region="myDs">
    {hostname}
</div>

Edited

How to put this code in another JS file and use it, coz "<%= request.getParameter(\"filepath\") %>" is creating problem

var cpath="<%= request.getParameter(\"filepath\") %>";
var myDs = new Spry.Data.XMLDataSet(cpath, "csmclient/system");     
$(document).ready(function(){
    $('<div>')                      // Creates the element
    .attr('spry:region','myDs') // Sets the attribute spry:region="myDs"
    .html('{hostname}')         // Sets the inner HTML to {hostname}
    .appendTo('body');
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T05:28:20+00:00Added an answer on May 23, 2026 at 5:28 am

    I’m surprised no one has yet fully made use of jQuery’s chaining capabilities:

    $('<div>')                      // Creates the element
        .attr('spry:region','myDs') // Sets the attribute spry:region="myDs"
        .html('{hostname}')         // Sets the inner HTML to {hostname}
        .appendTo('body')           // Append the newly created element to body
    

    Here’s a jFiddle example that shows it in action.

    UPDATE in response to your edit
    You won’t be able to use the Request object in an external javascript file like that, since the external script file is fetched by the browser in a separate request. You could easily solve the problem by writing an ASP.NET Handler script that returns your javascript file, by doing the following:

    1. Create a new handler in your ASP.NET project. Name it something sensible, like yourscriptname.js.ashx.
    2. Copy all your javascript code into the right place in the handler (you probably want a Response.Write() call or something…
    3. Change the src tag of your <script> element from somefile.js to somefile.js.asp?filepath=your/file.path.

    This way, when the request for the javascript is sent by the browser, the request object has a value for "filepath" and everything will work again. Of course, you’ll want to change your/file.path to something more relevant when you render it in the first place, in order to get the value from the request parameters to the page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can I create something like an Internet Explorer accelerator using JavaScript on the client-side?
I need to create a dynamic UI in WPF. Something like below, Date Hyatt
How can create a view with mutiple images, something similiar to the photo app
How can I create a barcode image in Java? I need something that will
I can create the following and reference it using area[0].states[0] area[0].cities[0] var area =
I want to create a jquery accordion dynamically by getting node names from the
I am trying to create an xml file like below in .NET. Actually I
I have the table like something like below, I use this to save the
i can use an XML file like below <set xmlns:android=http://schemas.android.com/apk/res/android android:interpolator=@android:anim/decelerate_interpolator> <translate android:fromXDelta=100% android:toXDelta=0%
How do I make a movable div that appears from bottom of screen. Like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.