How to open new screen on Samsung TV emulator? - javascript

I am working on Samsung TV application, so I made interning screen which tell the user some information about this application, after the user read the information he should click on welcome button to go to the main page.
So should I create a new html, then when I click on the button, a new page opening up?
Actually I was using this Technic in android applications!!!
So does this work on TV applications? If not, what should I do? Any advice will help, THANKS
Note: I study this code http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_win_open4
but this function didn't work

I suggest you to have a base html like this:
<body>
<div id="popup"></div>
<div id="content"></div>
</body>
And have your "screens" in separate html documents, and when you push a button, refresh your base html according, this way:
//on click
$('#content').html('');
$('#content').load('mynewcontent.html');
Samsung applications work with single page web app philosophy, so you must refresh the base html dynamically.
If you need to create a popup, there are lots of tutorials about how to make a div looks like a popup (manipulating position absolute, width, height, adding a semi-transparent black background...).
Expect this give you a clue, there is a long time I worked with samsung tv's.

Samsung TV applications do not have windows or tabs, so you cannot use open to create a new one.
Render your message inside the existing page with DOM manipulation instead.

Related

open another web-page in iframe, optimize for appearance

Looking to integrate a calendar scheduling service (http://calendly.com/), which is awesome and allows unauthenticated users to schedule appointments that then go into a Google Calendar.
However I want this all to happen on my site without users leaving.
Calendly doesn't offer this, so the workaround looks like this (click the top "Book it, baby!" button).
I want to do the same thing, but I really don't want to depend on some random javascript framework like fancybox.
What is a way to open a new link in an iframe such that it:
Is easily and gracefully exited from
Looks great as a new window on top of my site content
The content on the foreign page resizes to size of open screen as needed
Thanks all!
<a target="FRAME_NAME" id="showFrame" href="http://example.com">I open in an iframe!</a>
Then use javascript to display a hidden frame when an element with the id showFrame is clicked. You can then style the frame with css to make it fit the screen nicely.

How to show a page looks like on cellphone, tablets, and desktops without opening a new browser window

I am doing a web application which allows users to build pages. In addition to building pages, I will need to show how a page looks like on cellphone, tablet, and desktop without a user actually opening a browser of different viewport sizes to see how it looks.
Here is what I am planning to do a page as follows:
The page has two parts.
The top part contains three buttons labeled as cellphone, tablet, and desktop
The lower part show the actual user page.
Clicking on any of the buttons will show, in the lower part, how a user page looks like on the type of device corresponding to the type represented by a button.
I know that I have to use Javascript for this implementation, but I have no idea where to start.
Any thoughts/links/pointers are really appreciated.
Thanks and regards.
In Chrome you can emulate any size/screen size by opening developer tools and clicking the phone icon next to the magnifying glass in the top left corner. Here's some docs explaining it https://developer.chrome.com/devtools/docs/device-mode

How to animate book page turn effect in WebBrowser control in windows phone 8

I am working on windows phone 8 book reader application, i am showing my all html pages on a web browser control, so now when i page change by click next button it suddenly change the page and navigate to another page. I want page should flip like a real book page. If anything required for the answer please let me know, but help me in this.
If you are using a browser control the behavior is gonna be exactly as the website and you can't change it. but you can get a flip affect by using native windows8 xaml. Take a look at this:
http://msdn.microsoft.com/en-us/magazine/cc507644.aspx

Detect when user wants to open the in a new window/tab

I'm writing an AJAX application so every link on my page is a javascript link (href="javascript:void(blahblah)"). Some of them opens small webpages in an iframe in a boxed, absolutely positioned div element (that can be dragged around).
This looks nice but if the user middle click on the link he can't open the page in a new tab, because the browser tries to execute the script on a new page which fails.
So what I want to do is:
If the user clicks on the link it opens a webpage in an iframe in an absolutely positioned div. (this works currently).
If the user middle clicks these links (or somehow opens the link in a new tab/window etc.) the page should load in the new tab/window as expected.
Optional: middle click should do nothing on all other javascript links.
Is there a (preferably cross browser) way to accomplish this?
EDIT: this web app is a browser game which uses the canvas element to render the game world, so I don't mind if your solution works only in canvas-capable browsers.
Is there a (preferably cross browser) way to accomplish this?
Yes, don't do href="javascript:void(blahblah)", build on things that work.
Check out the hijax technique, which allows you to progressively enhance your application to use either regular or JavaScript links. There's an hijax jQuery plugin that can help.

Trigger click on embedded PDF

I have a PDF embedded in a web page using the following code:
<object id="pdfviewer" data='test_full.pdf#page=1&toolbar=0&statusbar=0&messages=0&navpanes=0'
type='application/pdf'
width='500px'
height='350px'>
The PDF itself is set to open in full screen mode which shows no controls. The user can advance the slides by clicking on the view.
What I'd like to have is some way to trigger that click so that I can advance 2 similar PDF:s side-by-side (one for the actual slideshow and one for the speaker notes). Is this possible to do in javascript and/or jQuery? I have tried using the click()-method but it doesn't get through to the embedded PDF.
Update: Can't find any info on it, so I guess I'm out of luck and have to try a workaround. Am currently juggling 3 embeds of the same pdf (current page, next page and previous page), hiding and showing them and loading more pages as the user clicks around.
I doubt it. Allowing web page scripts to pass input events to the PDF viewer could be a security risk (since the viewer generally has access to system file dialogues via things like Save As).

Categories