Explain the strange code html - html

I want to do a change in my site web (html+css+php)
I have this code html:
<h4>#_live_support#</h4>
In your opinion, what is the result of code??
No!No! result is not:
#_live_support#
a result CODE is Name Only:
Direct support
I want to explain this code please**
Photo caption
[code html]
http://goo.gl/vZQNXD
[Result]
http://goo.gl/4OaIvB

This is a template HTML file you are looking at. When the PHP script is called, #_LIVE_SUPPORT# will be dynamically replaced by whatever is appropriate at the time.

Related

Render value inside the another value in HTML

In html am rendering some value in the and passing it as a input to a component like
below
<test-component
[title]= "data?.Kevin?.title"
</test-component>
Please be noted data?.Kevin?.title will give the title name.How ever, in the above, I want to render the name a bit dynamically like below
<test-component
[title]= "data?.{{name}}?.title"
</test-component>
{{name}} should render kevin and the tile value needs to be passed to the component.
Here the name is not being rendered correctly.
Any help is highly appreciated.
the solution is pretty simple: [title]= "data?.[name]?.title"
the equivalent of the first example would be: [title]= "data?.["Kevin"]?.title"
read more on https://www.w3schools.com/js/js_objects.asp see "Accessing Object Properties"

Extracting data from API to html elements

I am not an experienced coder so excuse me if my explanation isn't perfect.
I'm making an html page and I'd like there to be a section that shows some Osu! stats. There's this osu api that spits out all of the information I could possibly need but there's a litle bit too much of it.
https://osu.ppy.sh/api/get_user?k=ff96ad02d159e0acad3282ad33e43a710dac96d5&u=Sceleri
The above returns:
[{"user_id":"6962718","username":"Sceleri","count300":"93129","count100":"15744","count50":"3404","playcount":"776","ranked_score":"184300015","total_score":"258886799","pp_rank":"345687","level":"34.115","pp_raw":"314.239","accuracy":"94.54791259765625","count_rank_ss":"1","count_rank_s":"55","count_rank_a":"74","country":"FI","pp_country_rank":"4112","events":[]}]
I'd like to parse a few numbers from there. Example:
"pp_raw":"314.239" -> <p>;314.239</p>;
The <p> would be inside a div and so on, where I can specify some CSS to it and make it look good. The main problem is extracting the data to separate <p> elements.
I have executed this with regex in Rainmeter before (I had help) but I have no idea how to do it in html.
Use Jquery ajax calls. The url you posted basically gives you a json object.
HTML:
<div id="pp_raw">
</div>
Jquery
$.get( "https://osu.ppy.sh/api/get_user?k=ff96ad02d159e0acad3282ad33e43a710dac96d5&u=Sceleri", function( data ) {
//You can put whatever you want in the style attr to make things pretty
$( "#pp_raw" ).html("<p style='color:red'>"+data[0]['pp_raw']+"</p> ");
});
JSFiddle:
https://jsfiddle.net/rwt5mdyk/8/

how put a html args in a message of grails?

I wish to insert into message a line like "view.mail.warning". It contains a html code, but using encodeAs="html", the message shows a href ... too and does not show a link. What is the correct way for do these things?. I don't want to insert the message in parts :(.
In a gsp:
<"p style='color:#ddd; font-size:12px; text-align:center;'> <"g:message code="view.mail.warning" encodeAs="html>
In message.properties:
<"view.mail.warning= textPart1 <"a href=['http://page.com']> <"g:message code="view.pageName"/> textPart2 <"a href='mailto:support#page.com'">'support#page.com' textPart3
The correct way /is/ to insert it in parts. However, if you /must/ include html in your properties file you can. What you can not include there however, is GSP/taglibs. Your call to g:message will never be parsed/executed. Messages from the resources are just strings. The following are perfectly valid:
messages.proprties
view.mail.warning=<p>I {0} do html in here!</p><em>But I {1} shouldn't.</em>
GSP
<g:message code="view.mail.warning" args="['can', 'really']" />
Output
<p>I can do html in here!</p><em>But I really shouldn't.</em>
A few things to note about this. As you can see you can pass arguments to your message codes. They are ordinal, and start a zero. This way you can tokenize your message and even pass values from your GSP to your messages.
This is the correct way to use message resource bundles in Grails.
For example:
message.properties
view.mail.warning= >p>I can do html in here!>/p> >p>But I really shouldn't.>/p>
GSP
Output
I can do html in here!>/p> >p>But I really shouldn't.
i want insert into message properties, message with strings+html

Mediawiki: Same section with multiple names (section aliases/synonyms)

Is it possible to give the same section multiple names in mediawiki out-of-the-box (vastly preferred), or do I need to write my own hook/extension/plugin (and if so, tips on how to do so much appreciated)?
In my case, I have example code on single compilation page that I want to link to for multiple individual articles by the name of each article. For instance, I would like something like the following the work.
Page: Interrupts Code Examples
===(EIMSK|EICRA)===
void interrupt01_init(void)
{
EICRA = 0X0F; // in binary, 1111. That is, the rising edge of INT1 and INT0 generate an interrupt request.
EIMSK = 0X03; // in binary, 0011. Enables INT0 and INT1 interrupts.
}
and both of the following would link to the same section, but with the appropriate name for each page:
Page: EICRA:
[[Interrupts Code Examples#{{PAGENAME}}]]
Page: EIMSK:
[[Interrupts Code Examples#{{PAGENAME}}]]
For full context, see example page http://narwhaledu.com/AVRwiki/index.php?title=PCMSK0.
It's possible I could use something like mediawiki: is there a way to automatically create redirect pages that redirect to the current page?, but is it possible to write it for sections instead of pages? Also, although acceptable, I would prefer not to have the allowed aliases be ALL the sections on a page; for instance, on http://narwhaledu.com/AVRwiki/index.php?title=Interrupts_Code_Examples, I have an "about" section.
Edit:
If it wasn't clear, ideally the when the user visits
Page: Interrupts Code Examples#PAGENAME
they see a properly populated section title, instead of "EIMSK or EICRA Example Code" (since there can be a LOT of aliases to a code example)
==={{{PAGENAME}}}===
void interrupt01_init(void)
{
EICRA = 0X0F; // in binary, 1111. That is, the rising edge of INT1 and INT0 generate an interrupt request.
EIMSK = 0X03; // in binary, 0011. Enables INT0 and INT1 interrupts.
}
I can get transclusion to work but not links.
Page: Template:Interrupts Code Examples
=={{#ifexist: {{{pagename}}} | [[{{{pagename}}}]] | External Interrupts Example Code One}}==
{{Template:ExampleCode~PCMSK0, PCMSK1, PCMSK2, PCICR, PCINT0_vect, PCINT1_vect}}
My ideal syntax would be
[[ Template:Interrupts Code Examples|pagename={{PAGENAME}} ]]
but obviously this produces instead a link to the nonexistant page pagename=Name_of_Register instead of linking to Interrupts Code Examples and passing the parameter {{PAGENAME}} such that I can reference it in Interrupts Code Examples with {{{pagename}}} and thereby generate my section header..
This would keep the compilation page clean (only have two code examples instead of copying each one 5x for each alias, my current solution), but I can only pass parameters to the template if I transclude, not if I link to the template, I believe. Is this true?
I may just use the "Example Code One" catchall for wiki markup readability in the end since this is starting to break my brain...
Any HTML anchor will work as a section link. So, if you have <span id="foo">, you can use [[Bla#foo]] to jump to the span. You'll need one HTML element per ID, but that's still workable I think.

How to clear non Widget contents in the HTML page in smartgwt

In my smartgwt application, the html page contains some code consisting of a div and a table.
This is show to the user until the call to server is completed. Once this is done, I want to remove the div and the table from the html page, how can I do that?
PS: I tried RootPanel.get("body").clear() and RootPanel.get("divID").removeFromParent()
and both didn't work
PLEASE HELP!
Try
yourDivOrElementToRemove= DOM.getElementById("idOfTheElement");
DOM.removeChild(RootPanel.getBodyElement(), yourDivOrElementToRemove);
Regards
Alain