Whatever I try I couldn't make this swf file work.
if I put all the files into my root everything works perfectly fine.
Here is my path format;
root: where my index.php located.
inside the root, I have a folder called "public".
inside "public" I have another folder called "_carousel_flash".
This is the place where my swf file is located.
I also have "js" folder located in this directory.
Here is the html code I'm using for adding the swf file.
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Galleria - Inspire Creativity</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="public/_carousel_flash/js/swfobject.js"> </script>
<script type="text/javascript" src="public/_carousel_flash /js/swfaddress.uncompressed.js"></script>
</head>
<body>
<div id="contents">
</div>
<script type="text/javascript">
var so = new SWFObject("public/_carousel_flash/block_slider.swf", "movie", "100%", "100%", "8", "#ffffff");
so.addParam("quality", "high");
so.addParam("id", "movie");
so.addParam("allowFullscreen", "true");
so.write("contents");
so.addParam("salign", "t");
</script>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Galleria - Inspire Creativity</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="public/_carousel_flash/js/swfobject.js"> </script>
<script type="text/javascript" src="public/_carousel_flash /js/swfaddress.uncompressed.js"></script>
</head>
<body>
<div id="contents">
</div>
<script type="text/javascript">
var so = new SWFObject("public/_carousel_flash/block_slider.swf", "movie", "100%", "100%", "8", "#ffffff");
so.addParam("quality", "high");
so.addParam("id", "movie");
so.addParam("allowFullscreen", "true");
so.write("contents");
so.addParam("salign", "t");
</script>
</body>
</html>
PUBLIC spell mistake
Or else i guess <script> tag is causing some issues, try embedding your swf object file
I can't be sure what's causing your error, but here are some things I notice about your code:
You're using SWFObject 1.x, which is very outdated and uses different syntax than SWFObject 2.x. Do you have the correct swfobject.js file for SWFObject 1.x? This is a fairly common issue for SWFObject users.
In SWFObject 1.x, you can't addParam after the so.write statement... it will not be reflected in your page.
so.write("contents");
so.addParam("salign", "t");
should be
so.addParam("salign", "t");
so.write("contents");
You have a typo in the URL for SWFAddress (a space just before "/js/").
If you want to be sure your SWF is located in the root, try loading it directly in the browser using the absolute URL.
Speaking of absolute URLs, it's often helpful to try them in your SWFObject code, too. Your current URL is file-relative; I suggest either using a site-relative URL ("/foldername/filename.swf") or an absolute URL ("http://yourdomain.com/foldername/filename.swf").
Related
I used window.print() function and saved to a .pdf file.
Inside the page I've saved there is a <a href="www.example.com"> tag. When I'm downloading the file from Chrome the link works and it opens the right page. When downloading it from Edge it won't work and stays as a simple text.
Any solution?
I tested and reproduced the issue. I think we can only use some plugins to generate the pdf to get the href link working in Edge Legacy.
You could use jsPDF to generate the PDF. Use .textWithLink() to mimic standard HTML hyperlinks:
doc.textWithLink(text, x, y, { url: url });
Sample code:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/jspdf/1.3.4/jspdf.debug.js"></script>
</head>
<body>
<script>
var doc = new jsPDF('p', 'pt');
doc.textWithLink('link', 20, 30, { url: 'http://www.google.com' });
doc.save("info.pdf");
</script>
</body>
</html>
I am a newbie to AngularJs and I am building a simple AngularJs web, I have set up the page and it works as I expect. But when I try to use the rootscope variable in the script part of my index.html. it always give an error: the variable is not define. However, I can still use the variable in the html part of the index.html. Can anyone tell me why it works like this? and how to resolve it?
Thanks.
Here is my simple HTML Code:
<!DOCTYPE html>
<html data-ng-app="test" lang='laCo'>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge; IE=10; IE=9">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet"
href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script>
$( function() {
loaddivpage();
});
loaddivpage = function(){
window.Final = user.userId;
$( "#innerdiv" ).load("./app/chat/Dialog.html");
}
</script>
</head>
<body>
<div id ="webdiv">
<div id = "innerdiv"> </div>
</div>
</body>
</html>
Here I want to load a Dialog.html into the innerdiv, which uses the window.Final variable. Note: user.userId is the rootscope variable.
I manage to find a way to do, since the html part has connection with the root scope, so I can use angular to fetch the root scope variable:
Like: By using angular.element($("#your div id ")).scope() to get scope of the html part, and then use this scope to access the root scope variable. Hope this will help someone else.
this is my code at index.html
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/>
<script src="javascript/jquery-1.11.1.min.js" type="text/javascript"></script>
<script src="javascript/i18next-1.7.4.js" type="text/javascript"></script>
<title>i18next test</title>
</head>
<body>
<p id="id001" data-i18n="first_data">first</p>
</body>
<script type="text/javascript">
$(document).ready(function(){
language_complete = navigator.language.split("-");
language = (language_complete[0]);
i18n.init({
lng: language,
resGetPath: 'locales/__lng__.json',
fallbackLng: "en",
}, function(){
$("first_data").i18n();
});
});
</script>
</html>
And I've created 2 json file at the same directory with index.html
locales/en.json
locales/de.json
json file content:
{
"first_data": "de-first-data"
}
Firefox try to load de.json and en.json but get the error 404.
Do you have any idea why i18next cannot load the json file.
This is my folder structure below:
index.html
locales/de.json
locales/en.json
javascript/i18next-1.7.4.js
javascript/jquery-1.11.1.min.js
You host application in IIS. IIS by default (as far as I know) doesn't support JSON file type.
Following question is related to same problem:
ERROR 404.3 Not Found for JSON file
Have you tried with ?
resGetPath: 'javascript/locales/__lng__.json',
i want to create a 'abc.txt' file in the folder where the .html file exist. in html5.
i tri with this code:
<html>
<head>
<title>title</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<script type="text/javascript">
function onInitFs(fs) {
fs.root.getFile('abc.txt', {create: true, exclusive: true}, function(fileEntry) {
}, errorHandler);
}
window.requestFileSystem(window.TEMPORARY, 1024*1024, onInitFs, errorHandler);
</script>
<input type="button" name="" id="" value="click" onclick="onInitFs(fs);"/>
</body>
</html>
But faild. Please tell me the correct method. (i tri with google chrome and letest firefox.)
From the documentation:
The LocalFileSystem interface of the File System API gives you access to a sandboxed file system.
It doesn't give you access to the main filesystem for the computer. It is a virtual one created by the browser. You can only access files in it that you put there from your own code.
Excuse me if this is an obvious question,
How can you use SWFobject to automatically redirect to another URL -
NOT add an a href but physically load another URL ?
I'm using SWFobject 2 at the moment .
-- the SWFobject code ...
swfobject.embedSWF("MYSITE.swf", "myAlternativeContent", "850", "700", "9.0.0", false, flashvars, params, attributes);
--- 2 tricks I've tried in the myAlternativeContent DIV ...
1 ...
<div id="myAlternativeContent">
<meta HTTP-EQUIV="REFRESH" content="0; url=http://www.NOFLASHSITE.com">
</div>
2 ...
<div id="myAlternativeContent">
<script language="javascript" type="text/javascript">
window.location="http://www.NOFLASHSITE.com";
</script>
</div>
--- both of these load the alternative (http://www.NOFLASHSITE.com) regardless ..
any help is apreciated - MW
According to the SWFObject API, you could do something like this:
<script type="text/javascript">
swfobject.addLoadEvent(function() {
if (!swfobject.hasFlashPlayerVersion("9.0.18")) {
window.location = "http://www.NOFLASHSITE.com";
}
});
</script>
Make sure that script block is in the <head> of your html file, and replace the "9.0.18" with whatever minimum version of flash you require.