script-tag

Load amazon script in react component

强颜欢笑 提交于 2020-01-05 05:34:04
问题 I have below script in my react component which works when I refresh the component. But when I navigate between the routes it doesn't work. import { inject, observer } from 'mobx-react' import React from 'react' @inject('store') @observer export default class Ads extends React.Component<{}> { public componentDidMount() { const div = document.createElement('div') div.id = 'amzn_assoc_ad_div_adunit0_0' const script = document.createElement('script') script.type = 'text/javascript' script.src =

Script tag works inside the body but doesn't work outside

折月煮酒 提交于 2019-12-25 02:13:17
问题 Hi I made a webpage that uses modal to display the output, I came in a scenario where in I put my script tags inside the body and the program work out fin, however when I was cleaning my codes and put the script tags outside the body. some parts cease to function, here's my code would appreciate it if you could help me debug it. here's a fiddle: http://jsfiddle.net/6x63w/ <div class="infobox"> <div id="shade"></div> <div id="modal"> <div id="envholder"> <img src="placeholder.png" id=

Embed Java Applet on GitHub Page

我们两清 提交于 2019-12-24 12:44:20
问题 I am working on a Java project that I am hosting on GitHub. I wanted to use GitHub Pages to have a page hosted on GitHub with the applet embedded. Now, I'm trying to embed an applet into the page, with the applet files hosted on GitHub on the gh-pages branch. I exported the Java applet as "exploded", so all of the class files show up in their correct hierarchy. In `index.html, I'm using this code: <section id="main_content"> <script> var attributes = {codebase: 'cubesorter/me/nrubin29

<script> not returned in AJAX

一曲冷凌霜 提交于 2019-12-24 07:07:36
问题 I am creating a WordPress theme and using AJAX to load new archive pages. The problem is that the whole < script type="text/javascript">//something//< /script> is not returned in the newly-acquired content. Suppose I have these codes initially : <div id="post-1"> <script type="text/javascript"> //some codes here// </script> <div class="content"> </div> </div> After navigating to the next page and back to this original page using AJAX, I will get these (in Firebug) instead : <div id="post-1">

Possible to get query parameters of the <script> src JavaScript URL?

家住魔仙堡 提交于 2019-12-24 06:39:04
问题 As an example, I have the following html: <body> <script src="code.js?q=xyz"></script> </body> I want to be able to read the q=xyz query parameter from within code.js . I tried: console.log(window.location.href) But it gives me the html document's URL, not code.js 's URL (I could then parse the URL for the query parameters). Is there any way to get an imported JavaScript file's query parameters from within that JavaScript? I know I could read the query parameters on a server and then send

Recaptcha - Script tag injection failing sporadically

北城以北 提交于 2019-12-22 07:10:14
问题 I have a form which uses reCAPTCHA. For some reason, when a user submits this form with an incorrect recapture value, when the page is re-rendered, the recapture fails to render. What it looks like it happening is that recapture attempts to inject a "script" tag, and sporadically (and only in certain browsers, certain environments, and in certain scenarios), it is failing to add that "script" tag to the DOM. It happens like this: 1) There is some inline javascript embedded in the form that

double hyphen in script makes firefox render strangely

柔情痞子 提交于 2019-12-20 04:15:12
问题 <!-- <script type="text/javascript">/*<![CDATA[*/ c-- ;//]]></script> --> When I have the above line in the <head> section of a plain html page, Firefox 3.5.5 renders the trailing --> as text. If I change c-- to c- it doesn't. Any ideas what's going on here? I getting an artifact on my pages with this due to a very large script that's been crunched. I can change the statement to c-=1 and avoid the problem for now but.... I'd like to know what bit/byte is biting my a$$. 回答1: This is due to

How to invoke a javascript function (generated from typescript) trapped within “System.register()” module while using Google protobuf?

廉价感情. 提交于 2019-12-19 09:27:36
问题 Update : It seems that, the problem is coming due to protobuf. I am fine with other solution as well, which help me to fix the Google protobuf issues. This problem boils down to: How to integrate Google protobuf with Typescript/Javascript for the browser? I am retaining below question for the future purpose. We have moved our application from Javascript to Typescript for obvious advantages of OOP etc.. Earlier invoking a direct javascript function from Html was as straight forward as: <script

html script tag not using type javascript <script type=“text/html”>?

孤街醉人 提交于 2019-12-18 14:46:26
问题 I was checking out the source on an html page and came across this <script id="searchItemTemplate" type="text/html"> <# var rows = Math.floor((Model.RecordsPerPage - 1) / 3 + 1); for (var i = 0; i < rows; ++i){ var startIdx = i * 3; var endIdx = startIdx + 3; #> //etc .... </script> I have never seen this before. What is script type="text/html" . I don't know if it makes a difference but this was on a .aspx page. Is this some sort of place holder to be parsed and eval() later? Does anyone

What language types are allowed in the HTML script tag?

只谈情不闲聊 提交于 2019-12-18 03:04:09
问题 I was looking at the W3C specs for the script tag, and I noticed you can specify VBScript and TCL as a language type. This is extremely new to me; I've only ever seen Javascript used with the script tag. Why aren't other languages more commonly used, and is there a complete list of languages you can use within this tag? 回答1: You can put anything you want in there. That's the whole point of MIME types. The question is of course whether or not your user's browser can actually interpret it. But