Search Results

Search found 111 results on 5 pages for 'w3schools'.

Page 5/5 | < Previous Page | 1 2 3 4 5 

  • Web Safe Area (optimal resolution) for web app design

    - by M.A.X
    I'm in the process of designing a new web app and I'm wondering for what 'web safe area' should I optimize the app layout and design. I did some investigation and thinking on my own but wanted to share this to see what the general opinion is. Here is what I found: Optimal Display Resolution: w3schools web stats seems to be the most referenced source (however they state that these are results from their site and is biased towards tech savvy users) http://www.w3counter.com/globalstats.php (aggregate data from something like 15,000 different sites that use their tracking services) StatCounter Global Stats Display Resolution (Stats are based on aggregate data collected by StatCounter on a sample exceeding 15 billion pageviews per month collected from across the StatCounter network of more than 3 million websites) NetMarketShare Screen Resolutions (marketshare.hitslink.com) (a web analytics consulting firm, they get data from browsers of site visitors to their on-demand network of live stats customers. The data is compiled from approximately 160 million visitors per month) Display Resolution Summary: There is a bit of variation between the above sources but in general as of Jan 2011 looks like 1024x768 is about 20%, while ~85% have a higher resolution of at least 1280x768 (1280x800 is the most common of these with 15-20% of total web, depending on the source; 1280x1024 and 1366x768 follow behind with 9-14% of the share). My guess would be that the higher resolution values will be even more common if we filter on North America, and even higher if we filter on N.American corporate users (unfortunately I couldn't find any free geographically filtered statistics). Another point to note is that the 1024x768 desktop user population is likely lower than the aforementioned 20%, seeing as the iPad (1024x768 native display) is likely propping up those number. My recommendation would be to optimize around the 1280x768 constraint (*note: 1280x768 is actually a relatively rare resolution, but I think it's a valid constraint range considering that 1366x768 is relatively common and 1280 is the most common horizontal resolution). Browser + OS Constraints: To further add to the constraints we have to subtract the space taken up by the browser (assuming IE, which is the most space consuming) and the OS (assuming WinXP-Win7): Win7 has the biggest taskbar footprint at a height of 40px (XP's and Vista's is 30px) The default IE8 view uses up 25px at the bottom of the screen with the status bar and a further 120px at the top of the screen with the windows title bar and the browser UI (assuming the default 'favorites' toolbar is present, it would instead be 91px without the favorites toolbar). Assuming no scrollbar, we also loose a total of 4px horizontally for the window outline. This means that we are left with 583px of vertical space and 1276px of horizontal. In other words, a Web Safe Area of 1276 x 583 Is this a correct line of thinking? I tried to Google some design best practices but most still talk about designing around 1024x768 which seems to be quickly disappearing. Any help on this would be greatly appreciated! Thanks.

    Read the article

  • Z-Index and javascript for rollover

    - by Raffaele
    I have a container (div) with a background image. In this div there is a menu - a horizontal list. What I need is to insert an image onMouseOver, positioning it absolutely, and showing it behind the text (of course!) AND on top of the div's background image. I also use jQuery, but I think this doesn't matter. The problem can be viewed online. Go to http://www.w3schools.com/css/tryit.asp?filename=trycss_zindex and paste the following text <html> <head> <style type="text/css"> img { top: 0; left: 0; position:absolute; z-index:-1; } #main { color: red; margin: 30px; padding: 20px; width: 700px; min-height: 400px; z-index: -2; background-image: url("http://www.google.com/logos/mother10-hp.gif"); background-repeat: no-repeat; } </style> </head> <body> <div id="main"> <h1>Z-Index question:</h1> <img src="w3css.gif" width="100" height="140" /> <p>How can we place the green pic between the text and the div#main?</p> <p>I need the green gif to appear</p> <ol> <li>On top of #main's background image</li> <li>Behind the text</li> </ol> </div> </body> </html>

    Read the article

  • how to save xml files using Javascript?

    - by user311884
    Dear friends, I tried to 1) load an xml file using javascript as an object, say "note.xml" 2) then save the object to a new xml file, say "note_new.xml" I did 1) but failed 2) I tried to use method save() to do 2). After my failure, I checked ms site and they said save() is not supported.... could some one enlighten me how to do the save? thank you! here is the code: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> </head> <body> <h1>W3Schools Internal Note</h1> <p><b>To:</b> <span id="to"></span><br /> <b>From:</b> <span id="from"></span><br /> <b>Message:</b> <span id="message"></span> <script type="text/javascript"> if (window.ActiveXObject){ alert("there is ActiveXObject"); var xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.async=false; xmlDoc.load("note.xml"); }else{ alert("i am not withActiveXObject!"); xhttp=new XMLHttpRequest(); xhttp.open("GET","note.xml",false); xhttp.send(""); xmlDoc=xhttp.responseXML; } xmlDoc.save("note_new.xml"); </script> </body> </html> update: seems this is related to security issue. I appologize to those experienced programmers for my putting this question in a rush because it seems a newbie question.

    Read the article

  • open,edit and save xml file with schema using php

    - by Neat
    Hy... I'm new in XML Schema, XSL,... (I have basic understanding) On web page: http://w3schools.com/xsl/xsl_editxml.asp is shown example for open,edit,save xml file, but with asp. Do anyone know how can i open/edit and save xml file using php for next example: <?xml version="1.0" encoding="ISO-8859-1"?> <tools> <tool id="1"> <field id="prodName"> <value>HAMMER HG2606</value> </field> <field id="prodNo"> <value>32456240</value> </field> <field id="price"> <value>$30.00</value> </field> </tool> <tool id="2"> <field id="prodName"> <value>Audi</value> </field> <field id="prodNo"> <value>88885</value> </field> <field id="price"> <value>$26.00</value> </field> </tool> </tools> and do i need <tool id="2"> or just <tool> is enough. Thanks very much on replay, and i don't need another xsl like shown on w3s, just fine is refresh submitted php file after submit (will do something with ajax after). I saw replay from Mr. Writman on questions/377632/add-update-and-edit-an-xml-file-with-php but that is for now 2 complex for me...:) is there any simpler answer (solution). Thanks in advance!!!

    Read the article

  • IE8 rendering of local-files is wrong

    - by Eric
    It appears that IE8 is not rendering properly a local file: Consider this simple webpage: http://sayang.free.fr/ie8render.html (html code below) extracted from a w3c tutorial on opacity. Save it locally and display it again: the local file has no opacity! That's very annoying, especially when one wants to design complex pages on prototypes placed in local files. Do you have a solution to that ? <html> <head> <title>IE8 Local File</title> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <meta http-equiv="pragma" content="no-cache" /> <meta http-equiv="cache-control" content="no-cache" /> <meta http-equiv="expires" content="-1" /> <style type="text/css"> div.background { width: 500px; height: 250px; background: url(http://www.w3schools.com/css/klematis.jpg) repeat; border: 2px solid black; } div.transbox { width: 400px; height: 180px; margin: 30px 50px; background-color: #ffffff; border: 1px solid black; /* for IE */ filter:alpha(opacity=60); /* CSS3 standard */ opacity:0.6; } div.transbox p { margin: 30px 40px; font-weight: bold; color: #000000; } </style> </head> <body> <h2>Save this file locally and open it to see the difference</h2> <div class="background"> <div class="transbox"> <p>This is some text that is placed in the transparent box. This is some text that is placed in the transparent box. This is some text that is placed in the transparent box. This is some text that is placed in the transparent box. This is some text that is placed in the transparent box.</p> </div> </div> </body> </html>

    Read the article

  • dbms_xmlschema fail to validate with complexType

    - by Andrew
    Preface: This works on one Oracle 11gR1 (Solaris 64) database and not on a second and we can't figure out the difference between the two databases. Somehow the complexType causes the validation to fail with this error: ORA-31154: invalid XML document ORA-19202: Error occurred in XML processing LSX-00200: element "shiporder" not empty ORA-06512: at "SYS.XMLTYPE", line 354 ORA-06512: at line 13 But the schema is valid (passes this online test: http://www.xmlme.com/Validator.aspx) -- Cleanup any existing schema begin dbms_xmlschema.deleteschema('shiporder.xsd',dbms_xmlschema.DELETE_CASCADE); end; -- Define the problem schema (adapted from http://www.w3schools.com/schema/schema_example.asp) begin dbms_xmlschema.registerSchema('shiporder.xsd','<?xml version="1.0" encoding="ISO-8859-1" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="shiporder"> <xs:complexType> <xs:sequence> <xs:element name="orderperson" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>',owner=>'SCOTT'); end; -- Attempt to validate declare bbb xmltype; begin bbb := XMLType('<?xml version="1.0" encoding="ISO-8859-1"?> <shiporder xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="shiporder.xsd"> <orderperson>John Smith</orderperson> </shiporder>'); XMLType.schemaValidate(bbb); end; Now if I gut the schema definition and leave only a string in the XML then the validation passes: begin dbms_xmlschema.deleteschema('shiporder.xsd',dbms_xmlschema.DELETE_CASCADE); end; begin dbms_xmlschema.registerSchema('shiporder.xsd','<?xml version="1.0" encoding="ISO-8859-1" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="shiporder" type="xs:string"/> </xs:schema>',owner=>'SCOTT'); end; DECLARE xml XMLTYPE; BEGIN xml := XMLTYPE('<?xml version="1.0" encoding="ISO-8859-1"?> <shiporder xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="shiporder.xsd"> John Smith </shiporder>'); XMLTYPE.schemaValidate(xml); END;

    Read the article

  • clarification on the concept of "web service"

    - by udit
    Im a little confused on the varying definitions and implementations of web services available as implementations. Need some clarification please. Ones I have used till now: If a vendor gives me a specific format of XML that I can send populated with data to request and I make a simple HTTP POST over the internet passing in the XML String as the payload, is this a web service call ? If so, is there a specific name to it, this kind of web service ? Because obviously, it does not use anything like Axis, WSDL or SOAP to establish this connection. A variant of this is If the vendor gives me an XSD, I use JAXB to make a java class out of it and pass in the serialized version of the object, which eventually works out to be the same as option 1. RESTful web service: Vendor gives me a URL like http://restfulservice/products and I can make HTTP Requests to the URL and depending on what HTTP verb I use, the appropropriate action is called and the response sent over the wire. Ones I have only read about\ have a vague idea about SOAP. How does this work?.. Ive read the W3Schools tutorial and I undertsand that there is a very specific form of XML that is standardized according to W3C standards that we use to pass the same kind of messages as we did in option 1. But how does this work in real life? Vendor sends me what? Do I generate classes? Do I serialize some objects and http post them over to an address? Or do the generated objects themselves have connection methods that will do them for me? What about WSDL? When does a vendor send me WSDL and what do I do with it ? I guess I can generate classes from it. If yes, then what do I do with the generated classes ? When do I need that axis jar to generate classes from something that the vendor sends ? As you can see, I have some clear and other mostly vague ideas about the different kinds of web services available. would help if someone ould clarify and\or point to more real-world resources. I've looked a little bit into Java Web Services on the internet and the numerous four letter acronyms that get thrown at me make me dizzy. Thanks

    Read the article

  • MVC Razor Engine For Beginners Part 1

    - by Humprey Cogay, C|EH, E|CSA
    I. What is MVC? a. http://www.asp.net/mvc/tutorials/older-versions/overview/asp-net-mvc-overview II. Software Requirements for this tutorial a. Visual Studio 2010/2012. You can get your free copy here Microsoft Visual Studio 2012 b. MVC Framework Option 1 - Install using a standalone installer http://www.microsoft.com/en-us/download/details.aspx?id=30683 Option 2 - Install using Web Platform Installer http://www.microsoft.com/web/handlers/webpi.ashx?command=getinstallerredirect&appid=MVC4VS2010_Loc III. Creating your first MVC4 Application a. On the Visual Studio click file new solution link b. Click Other Project Type>Visual Studio Solutions and on the templates window select blank solution and let us name our solution MVCPrimer. c. Now Click File>New and select Project d. Select Visual C#>Web> and select ASP.NET MVC 4 Web Application and Enter MyWebSite as Name e. Select Empty, Razor as view engine and uncheck Create a Unit test project f. You can now view a basic MVC 4 Application Structure on your solution explorer g. Now we will add our first controller by right clicking on the controllers folder on your solution explorer and select Add>Controller h. Change the name of the controller to HomeController and under the scaffolding options select Empty MVC Controller. i. You will now see a basic controller with an Index method that returns an ActionResult j. We will now add a new View Folder for our Home Controller. Right click on the views folder on your solution explorer and select Add> New Folder> and name this folder Home k. Add a new View by right clicking on Views>Home Folder and select Add View. l. Name the view Index, and select Razor(CSHTML) as View Engine, All checkbox should be unchecked for now and click add. m. Relationship between our HomeController and Home Views Sub Folder n. Add new HTML Contents to our newly created Index View o. Press F5 to run our MVC Application p. We will create our new model, Right click on the models folder of our solution explorer and select Add> Class. q. Let us name our class Customer r. Edit the Customer class with the following code s. Open the HomeController by double clickin HomeController of our Controllers folder and edit the HomeControllerusing System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc;   namespace MyWebSite.Controllers {     public class HomeController : Controller     {         //         // GET: /Home/           public ActionResult Index()         {             return View();         }           public ActionResult ListCustomers()         {             List<Models.Customer> customers = new List<Models.Customer>();               //Add First Customer to Our Collection             customers.Add(new Models.Customer()                     {                         Id = 1,                         CompanyName = "Volvo",                         ContactNo = "123-0123-0001",                         ContactPerson = "Gustav Larson",                         Description = "Volvo Car Corporation, or Volvo Personvagnar AB, is a Scandinavian automobile manufacturer founded in 1927"                     });                 //Add Second Customer to Our Collection             customers.Add(new Models.Customer()                     {                         Id = 2,                         CompanyName = "BMW",                         ContactNo = "999-9876-9898",                         ContactPerson = "Franz Josef Popp",                         Description = "Bayerische Motoren Werke AG,  (BMW; English: Bavarian Motor Works) is a " +                                       "German automobile, motorcycle and engine manufacturing company founded in 1917. "                     });                 //Add Third Customer to Our Collection             customers.Add(new Models.Customer()             {                 Id = 3,                 CompanyName = "Audi",                 ContactNo = "983-2222-1212",                 ContactPerson = "Karl Benz",                 Description = " is a multinational division of the German manufacturer Daimler AG,"             });               return View(customers);         }     } } t. Let us now create a view for this Class, But before continuing Press Ctrl + Shift + B to rebuild the solution, this will make the previously created model on the Model class drop down of the Add View Menu. Right click on the views>Home folder and select Add>View u. Let us name our View as ListCustomers, Select Razor(CSHTML) as View Engine, Put a check mark on Create a strongly-typed view, and select Customer (MyWebSite.Models) as model class. Slect List on the Scaffold Template and Click OK. v. Run the MVC Application by pressing F5, and on the address bar insert Home/ListCustomers, We should now see a web page similar below.   x. You can edit ListCustomers.CSHTML to remove and add HTML codes @model IEnumerable<MyWebSite.Models.Customer>   @{     Layout = null; }   <!DOCTYPE html>   <html> <head>     <meta name="viewport" content="width=device-width" />     <title>ListCustomers</title> </head> <body>     <h2>List of Customers</h2>     <table border="1">         <tr>             <th>                 @Html.DisplayNameFor(model => model.CompanyName)             </th>             <th>                 @Html.DisplayNameFor(model => model.Description)             </th>             <th>                 @Html.DisplayNameFor(model => model.ContactPerson)             </th>             <th>                 @Html.DisplayNameFor(model => model.ContactNo)             </th>         </tr>         @foreach (var item in Model) {         <tr>             <td>                 @Html.DisplayFor(modelItem => item.CompanyName)             </td>             <td>                 @Html.DisplayFor(modelItem => item.Description)             </td>             <td>                 @Html.DisplayFor(modelItem => item.ContactPerson)             </td>             <td>                 @Html.DisplayFor(modelItem => item.ContactNo)             </td>                   </tr>     }         </table> </body> </html> y. Press F5 to run the MVC Application   z. You will notice some @HTML.DisplayFor codes. These are called HTML Helpers you can read more about HTML Helpers on this site http://www.w3schools.com/aspnet/mvc_htmlhelpers.asp   That’s all. You now have your first MVC4 Razor Engine Web Application . . .

    Read the article

  • Android webview doesn't playing mp4 video in same page

    - by user1668105
    I'm trying to show one local html file contains code for playing video and try to show that html file in android webview. I've used following code to for playing video: WebViewLoadVideoActivity.java //DECLARE webview variable outside of onCreate function so we can access it in other functions (menu) @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); WebView webView = (WebView) findViewById(R.id.webView1); WebSettings webSettings = webView.getSettings(); // Fetches the // WebSettings // import WebViewClient webViewClient = new WebViewClient(); webView.setWebViewClient(webViewClient); // Enabling mp4 webSettings.setPluginsEnabled(true); // Allows plugins to run which are // normally disabled in webView webView.getSettings().setBuiltInZoomControls(true); // Allows the // Android built in // zoom control webView.getSettings().setSaveFormData(true); webView.getSettings().setLoadsImagesAutomatically(true); webView.getSettings().setPluginsEnabled(true); webView.getSettings().setLoadsImagesAutomatically(true); webView.getSettings().setSupportMultipleWindows(true); webView.getSettings().setPluginsEnabled(true); webView.getSettings().setLightTouchEnabled(true); webView.getSettings().setAllowFileAccess(true); // To allow file // downloads/streams // such as mp4, mpeg, // and 3gp files webView.getSettings().setJavaScriptEnabled(true); // Enables HTML // Javascript to run // in webview webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true); webView.getSettings().setSupportZoom(true); // Support the zoom feature webView.getSettings().setSavePassword(true); // Allow users to save passwords in forms webView.setWebViewClient(new WebViewClient() { // Opens web links clicked by user in the webview @Override public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { // Handle the error } @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } }); webView.loadUrl("file:///android_asset/test.html"); // test.html file from assets folder //... Rest of activity code... test.html <!DOCTYPE html> <html> <body> <video width="320" height="240" controls="controls"> <source src="http://www.w3schools.com/html/movie.mp4" type="video/mp4" /> Your browser does not support the video tag. </video> </body> </html> Problem Area : Android webview or Android Default Browser shows the video content in another video view when we click play button, My requirement is that video should be opened in same html page inline, so user can navigate to other page of webpage during video is playing or buffering. Research Area : I tried many other ways like, video tag of HTML5 embed tag of HTML object tag of HTML Other way of video player integration i checked so far but not worked in my requirement, Flare Video jplayer Please suggest me any way that can be suitable for my requirement, And my requirement is very simple as, I want to play video in html file as inline in webview widget of android. Thanks in Advance.

    Read the article

  • Looping through siblings of a specific row/setting up function

    - by Matt
    Trying to work through my javascript book I am referencing to learn the language and got stuck on looping through siblings of a specific row. W3schools and W3 didnt have what i was looking for. Below is a function walk-through... It reads: Create the countRecords() function. The purpose of this function is to count the number of visible rows in the data table after the table headings. The total is then displayed in the table cell with the id "records". Add the follow commands to the function: a. Create a object named headRow that points to the table row with the id "titleRow". Create a variable named rowCount, setting its initial value to 0. b. Create a for loop that uses familial references starting with the first sibling of headRow and moving to the next sibling until there are no siblings left. Within the for loop. test whether the node name of the currentnext sibling until there are no sibilings left. Within the for loop test whether the node name of the current node is equal to "TR". If it is, test wheter the value of its display style is equal to an empty text string. If it is (indicating that it is visible in the document) increate the value of the rowCount variable by 1. c. Change the text of the "records" table cell to the value of the rowCount variable. Don't use innerHTML. Create a text node that contains the value of the rowCount variable and assign it to a variable called txt. Create a variable called record to store the reference to the element "records" table cell. d. Insert an if condition that test whether the "records" cell has any child nodes. If it does, replace the replace the text node of the "record" table cell with the created text node (txt). If it doesn't append the text node to the cell. var headRow; // part a var rowCount = 0; //part b this is where I get lost. I know I need to access the id titleRow but unsure how to set my loop up specifically for this headRow = document.getElementById("titleRow"); for(var i=0; i<headrow.length; i++) { if (something is not equal == "TH") { make code happen here } if (is "TR" == ""){ rowCount = +1; } //part c var txt = document.createTextNode(rowCount); var record = document.getElementsById("records") //part d holding off on this part until I get a,b,c figured out. The HTML supporting snippet: <table id="filters"> <tr><th colspan="2">Filter Product List</th></tr> <tr> <td>Records: </td> <td id="records"></td> </tr> <table id="prodTable"> <tr><th colspan="8">Digital Cameras</th></tr> <tr id="titleRow"> <th>Model</th> <th>Manufacturer</th> <th>Resolution</th> <th>Zoom</th> <th>Media</th> <th>Video</th> <th>Microphone</th> </tr> Thanks for the help!

    Read the article

  • javascript won't execute nested for loop

    - by mcdwight6
    thanks in advance for all your help! i'm fairly new to javascript, but i have a fairly strong background in java, so i thought i would try it out on this project i'm working on. essentially, what i'm trying to do is read data from an xml file and create the html code for the page i'm making. i used the script from w3schools found here. I've altered it and gotten it to pull the data from my own xml and even to do the more basic generation of the html code i need. Here's the html i'm using inside <script> tags: var s = swDoc.getElementsByTagName("planet"); var plShowsArr = s[i].getElementsByTagName("show"); var plGamesArr = s[i].getElementsByTagName("videoGame"); for (i=0;i<s.length;i++) { // test section all works document.write("<div><table border = \"1\">"); document.write("<tr><td>"+ s[i].getElementsByTagName("showText")[0].childNodes[0].nodeValue + "</td><td>" + s[i].getElementsByTagName("showUrl")[0].childNodes[0].nodeValue + "</td></tr>"); document.write("<tr><td>" + s[i].getElementsByTagName("gameText")[0].childNodes[0].nodeValue + "</td><td>" + s[i].getElementsByTagName("gameUrl")[0].childNodes[0].nodeValue + "</td></tr>"); document.write("</tr></table></div>"); // end test section document.write("<div class=\"appearances-row\"><ol class=\"shows\">shows list"); for(j=0;j<plShows.length;j++){ document.write("nested for"); var showUrl = s[i].getElementsByTagName("showUrl")[j].childNodes[0].nodeValue; var showText = s[i].getElementByTagName("showText")[j].childNodes[0].nodeValue; document.write("<li><a href=\""+showUrl+"\">"+showText+"</a></li>"); } the code breaks at the nested for loop at the end, where it finished the document.write and prints "shows list" to the page, but then never gets to the document.write inside. if it helps, the xml contains a list of planets from the star wars universe organized like this: <planets> <planet> <planetName>planet</planetName> <description>some text</description> <appearances> <show> <showUrl>url</showUrl> <showText>hyperlink text</showText> </show> <videoGame> <gameUrl>url</gameUrl> <gameText>hyperlink text</gameText> </videoGame> </appearances> <locationsOfInterest> <location>location name</location> </locationsOfInterest> <famousCharactersRelatedTo> <character>a character</character> </famousCharactersRelatedTo> <externalLinks> <link> <linkUrl>url</linkUrl> <linkText>hyperlink text</linkText> </link> </externalLinks> </planet>

    Read the article

< Previous Page | 1 2 3 4 5