3

Possible Duplicate:
Show modal JS dialog on any site using button

I need some kind of advise, how to use technologies to achieve following functionality:

So, some web-developer place piece of code on his site, like this:

 <script src="http://mydomain/Scripts/LoadDialog" 
type="text/javascript"></script>
    <img src="http://mydomain.com/image"
     onclick="window.ShowModalDialog(someArgs, **UserID**);" />

When user pressing on image button, there is server call occurs, and depending on userID server will return content. As a server side technology is planed to use ASP.NET MVC. On front-end side will be JavaScript and jQuery. Please let me know please if you know how it can be achived or where I can start from.

NOTE: Generally, these code should be placed on a site what user wants.

Community
  • 1
  • 1
Alexandr
  • 1,452
  • 2
  • 20
  • 42

2 Answers2

3

Check out the following blog entry, it helped me a great deal while developing something similar

http://alexmarandon.com/articles/web_widget_jquery/

In general, keywords for you are dynamic javascript and css loading and JSON-P that enables getting around browser's same origin policy while sending AJAX requests.

Master Slave
  • 27,771
  • 4
  • 57
  • 55
  • Thanks. Do you have any expreience with such issue? – Alexandr Jan 02 '12 at 19:50
  • Yes, I do have some experience developing third-party web widgets. Ask, whenever you have some concrete problems, I will gladly help you whenever time allows me to do so. Best – Master Slave Jan 03 '12 at 12:46
1

Look at this SO post jsonP and the ticked answer provides an example of pretty much what it sounds like you want to do (in MVC / Javascript)

Community
  • 1
  • 1
K. Bob
  • 2,668
  • 1
  • 18
  • 16