Search code examples
javascriptasp.netinnerhtmlresx

Accessing Resx in Javascript


Okay I trying to make site handle different languages so I am using a resx file.

I can display simply Welcome on aspx page like this:

<asp:Label runat='server' ID="foo" meta:resourcekey='WelcomeText'/>

Now I want to be able to use javascript to do innerHTML:

"<div>
    <asp:Label runat='server' ID="foo" meta:resourcekey='WelcomeText'/>
</div>"

But it does not work like that. I have tried to also do getElementById which keeps returning null.

Any Ideas?


Solution

  • You can read like

    var author = $('meta[name=author]').attr("content");
    

    Is it possible to use jQuery to read meta tags

    How to find and read metadata using jQuery (schema.org microformat)?