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 8534893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:18:10+00:00 2026-06-11T10:18:10+00:00

So i have a web app I have been building, and I receive generated

  • 0

So i have a web app I have been building, and I receive generated html from a server for a post, and place it within the body. My question is: is there a way to set a default onclick behavior for the tag within that message? I’d rather avoid parsing through the html and setting behavior for each tag. I may just be having a brain fart but felt its best just to ask. The goal behind this is to enable a card switch to full screen the image. I just cant figure out how to set the click behavior. Thanks in advance.

  • 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-06-11T10:18:11+00:00Added an answer on June 11, 2026 at 10:18 am

    You can use an Ext JS component to do this. Any number of the Ext components will work this way but the base Component is all that is needed.

    Once the server returns the html data, use the Component’s update method. Bind to the click event of the Component’s html element and then any html element that is clicked inside of the component will fire the click event. Within the function bound to the event, the event object will be available and will tell you what was clicked.

        Ext.onReady(function() {
            var htmlContainer,
                htmlFromServer;
    
            /*
             * you can create a component that will be 
             * be used to set the html into the page
             * while allowing it to be managed from Ext JS
             */
            htmlContainer = Ext.create('Ext.Component', {
                renderTo: Ext.getBody(),
                width: 400,
                height: 400
            });
    
            /*
             * this would be html from your service call
             * this is just a simplified example
             */
            htmlFromServer = '<div>Click this Div and this will be the event target. Click the image and that will be the value of the event target.</div><img src="http://www.sencha.com/img/apple-touch-icon.png" /><span>And this is some span-wrapped content.</span>';
    
            /* update the component with the html you want it to contain */
            htmlContainer.update(htmlFromServer);
    
            /* bind to the click event of the components html element */
            htmlContainer.getEl().on('click', function (event) { console.log('event object and html element that was clicked:', event, event.target)});
    
        });​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been building a client / server app with Silverlight, web services, and
I am learning Python and building my first web app. I have been going
I'm trying to build my Flex/Java web app from within IntelliJ rather than have
I have been asked to implement some email address validation on a web app
So I have been developing a small ASP.NET web app in C# for my
I have a web app that reads data from a SQL DB that contains
I am new to web development and have been building my websites in Visual
I've been intermixing JSPs and Servlets in the web app I'm building and I'm
I'm currently working on a web app, and have been inspired by a couple
I have setup a web app for a client. The server is in US

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.