Ignorant WebView tags html anchor

I use a WebView in my application of waterfalls to view help for the application. Many of the pages have hyperlinks to topics about other help pages, but WebView not scrolls at anchor on the other page.

I tested my help html in Chrome is WebKit based too and makes the same as display Web help. I discovered that Chrome seems to apply HTML5 and so has removed in favour of the , because the "name" attribute is deprecated in HTML5. This solved the problem in Chrome, which also was not scrolling to the anchor on the page target, but it has no effect in the Web mode. It will not even go down until in the right place even when the anchor tags using id rather than by name.

Has anyone else experienced this and more importanly, nobody knows how to get the anchor tags to work properly in a WebView? Some of my help topics are quite long, and used reading all the way until you find a subject from another page is not very friendly.

Thank you.

OK, I came up with my own solution to this. I can't understand why the WebView does not respect the hash of the anchor on the URL, but for now, it works like a charm.

I had the idea of trying to run JavaScript in the WebView force it to scroll when I wanted to. The general consensus among developers JS, is that all you have to do is this:

location.hash = 'anchorID';

.. who can work very well for good browsers, but everything he says WebView do a reload the page with the hash plated anchor on the end, even once, what he does, but of course he simply ignores the anchor again. After some research, I found an another guru that suggests something completely different. So different in fact that readers of the forum was laughing that it wouldn't work, and anyway it was too complicated compared to the idea of location.hash . As soon as I saw him, but I knew it was probably solve my problem. The simple JavaScript snippet that he provided looked something like this:

element = document.getElementById('" + anchorID + "');
element.scrollIntoView();

I've expanded this nugget of kernel in this:

WebView {
   onLoadingChanged: {
      var token;
      if (loadRequest.status == WebLoadStatus.Succeeded) {
         var tempStr = url.toString();
         var hashIndex = tempStr.lastIndexOf("#");
         if (hashIndex > -1) {
            // ---There is an anchor hash on the end of the URL. Force WebView to use it.
            var tempStr = tempStr.substring(hashIndex + 1);
            token = evaluateJavaScript("element = document.getElementById('" + tempStr + "');element.scrollIntoView();");
         }
      }
   }
}

Basically what this does that get a # character at the end of the URL, and if there are any characters after it are passed to JavaScript which seeks the element and then scrolls to it. Note that, because this script using getElementById() you must set your anchor points with the id = "" attribute. " If you want to use the old style that should work too, but I have not tried. Something like that...

evaluateJavaScript("element = document.getElementsByName('" + tempStr + "')[0];element.scrollIntoView();");

This example assumes that you have only one element on the page with this name. If this isn't the case, you will need to change appropriately array index.

Hope this helps someone.

UPDATE: Just tested the alternative version using getElementsByName() and it works perfectly also. Just be sure to have only one of the items on each page with the name of the anchor. Unlike identifiers, names must be unique.

Tags: BlackBerry Developers

Similar Questions

  • Apply the tag html for the built-in fonts

    Jin

    I have a textfield, I have fonts embedded and assigned htmlText, i.e.

    txt.embedFonts = true;

    txt.htmlText = '< b > text < /b >';

    but it's not aplly tags html because of IncorporerPolices... I tried to style using css but did not...

    is there a way to do this?

    Be sure to set the property to true html . txt.html = true; So that you can have embedded characters of bold and non-bold, you need to create 2 dynamic textfields hidden (off stage), who has the "BOLD" value via the Inspector properties and the other not "BOLD". Stir the two textfields with the characters you need.

    Source: http://kb2.adobe.com/cps/160/tn_16054.html

  • HTML anchors

    Hello. I'm trying to generate some of the content of aid as a quick intro to section of our website. In doing so, I would like to create HTML anchors so that other pages can link to specific sections. These sections are not topics for help, but are subtitles within a single topic. Is it possible to set of anchor points for these subheadings so they are created as part of the HTML generation in Robohelp?

    I haven't the time to check this right now, but I think remember me HR for Word using the topic medium term IDs. Search in the Insert menu.

    -Lori

  • text HTML anchor tag uses the line

    Here is one. When I shoot html as text in a text field, and set the paragraph to align to the right, the entire line is defined as a link.

    Is there anyway to make sure the link is not made for the entire line?

    Example:

    < p align = "right" > < a href = "link" > Link Text < /a > < /p >

    Any help would be appreciated.

    Wally

    TIm,

    Thanks for that. I came up with the same results. Because I'm all loading of external files, I wanted to shy from the exhausts of all these characters. But you certainly helped me to find a solution.

    I took some of my text links and dropped everything in a test film I've worked with and has accidentally left thetag in the head, which appears in the html code. Needless to say that the text "untitled document" doesn't have the hyperlink applied.<p class="reply"> <p class="reply">So I got to thinking, "what happens if I put text before and after the anchor tag." And sure enough. NO HYPER LINK on the new text. Then I got to thinking, 'Hmm. Maybe I'll just put a character before and after the hyperlink and set its color to white so it will not be displayed. »</p> <p class="reply">Of course, it worked. So this is my fix/workaround. If you have a hyperlink which is aligned to the right and it appears on the line, put a character before and after the hyperlink and do he same as the background color.</p> <p class="reply">It worked, but <strong>HELLO ADOBE / FLASH TEAM!</strong> Please fix the bug and implement HTML 4.0 or higher if we don't get to these workaround solutions crazy, <em>Please</em>.</p> <p class="reply">Thanks to all who helped on this. Great community!</p> <p class="reply">Wally</p>

  • Tag HTML special characters

    Hi all

    I have a news rss application where I get some special characters in the stream. I have addded '"tag to the text, so the label analysis as a web page. The problem is that when the text contains special characters like "o" or similar BB ignores it and doesn't show anything.

    An example will show better:

    QString title = "Hello text: ó";
    Label *l = Label::create();
    l->setText(""+title+"";
    

    The expected result is:

    Hello text: o

    The actual result is:

    Hello the text:

    Best regards.

    Seems that Yes. Or rather an incomplete implementation.

    Numeric codes seems to work well. If you need to use a tag a possible workaround is something like this:

    title.replace("Ó", "Ó");
    title.replace("ó", "ó");
    

    Replacement of the other HTML entities may be necessary as well, here is their list:

    http://www.w3schools.com/tags/ref_entities.asp

  • Using WebEngine + WebView rich HTML control?

    Someone has already tried using WebEngine/WebView to create (static) content, which can combine text with images?

    What I would like is a control capable of reflow where I can put in text style (different styles, sizes, fonts) and some pictures go hand in hand and that the text nicely reflow around the images. Since HTML has been able to do this for centuries, and since I donot think that even a new RichText control will be able to mix images and text (and certainly not to offer all other features in HTML, such as tables, etc...), I think the Web view could fill this gap.

    Get the page HTML itself inside the control is easy, using the loadContent methods... but what about pictures? I would need some kind of hook to provide Images directly (from a database or memory, no intermediate download URL step) for the WebEngine, but it seems not to be.

    I guess I could put up a local Web server and point my "img src" tags to get what I want, but there may be an easier way?

    Let me know.

    I've been kicking around the idea of pair components WebView/WebEngine with an http server embedded in my application. I saw something as the pier. It is probably overkill for your application.

    Since you mention only static images residing in a database, I think that you can embed the image directly in the HTML code as an object of data with the appropriate mime type.

    This link has a discussion about it:

    http://rifers.org/blogs/gbevin/2005/4/11/embedding_images_inside_html

    and so for this:

    http://www.campaignmonitor.com/blog/post/1761/embedding-images-in-email/

    If you need an example of this, just check your email SPAM. These guys are experts.

    I think it goes something like this:

    -Pat

  • How to separate the tag html to a string?

    Hai,

    I need to separate the HTML string. My channel have some XXXXXtags I need to change these tags(prividing some styles) everyone knows to separate html string tags please help

    Thank you

    Dembélé

    I found the solution

  • Tags HTML and code displayed on the page of the App.

    I'm working on Apex 4.2 on a group calendar page pre-packaged application 1

    I have modified this code in the area of legend on page 1 and then noticed that when I did the raw html code was posted on the page instead of the data parsed html (see image)

    rawHTML.PNG

    I do not see the HTML tags and the code on the page? However when I replaced the modified code with the original code (as shown in the picture which is the original code) I still see HTML tags?

    How can I fix the code in the legend area so the HTML is parsed and the display on the screen does not include HTML tags and or code on the page?

    Richie V wrote:

    I'm working on Apex 4.2 on a group calendar page pre-packaged application 1

    I have modified this code in the area of legend on page 1 and then noticed that when I did the raw html code was posted on the page instead of the data parsed html (see image)

    I do not see the HTML tags and the code on the page? However when I replaced the modified code with the original code (as shown in the picture which is the original code) I still see HTML tags?

    How can I fix the code in the legend area so the HTML is parsed and the display on the screen does not include HTML tags and or code on the page?

    Make sure the column attribute to display as is defined on the column Standard report and not display text (escape special characters, does not save the State).

  • Creating a tag HTML with Dreamweaver/Muse and its import for Joomla?

    Hello

    I was wondering if it is able to find a way to connect between Joomla and Adobe Dreamweaver.

    So I'm a designer and I would like to use my skills in design of photoshop and illustrator to create a Web site. So I'm reshape an Internet site to my work and their site is out of Joomla. I know how to import photoshop or illustrator Dreamweaver files and download a html on the web, but I did not download a html/css for Joomla. I have no idea whatsoever about Joomla, but I am familiar with HTML and CSS, and its conversion to filezilla.

    Please help, I want my online drawing or an overview of Joomla and see how it goes from there because I'm not a developer... just a designer.

    Thank you.

    You do not import HTML/CSS in Joomla and you can copy and paste your code in a selective way.

    Joomla already has a Web page for you and all you have to do is to copy the content of your page of DW in Joomla.  This means all the code between the....the HTML tags in the code editor for DW.  All this is done in 'Items', and you will need to switch between HTML and WYSIWYG editor.

    Also, please note that Joomla 3.4.8 (the current version) uses "bootstrap" version 2.3.2 and there is no easy way to upgrade to version 3.3.6 bootstrap one we use in DW.  The tutorial for 2.3.2 are at this link:

    http://GetBootstrap.com/2.3.2/base-CSS.html

    http://GetBootstrap.com/2.3.2/components.html

    http://GetBootstrap.com/2.3.2/scaffolding.html

    Codes between the two versdioins are very different, so when you post a question here, you must indicate your Bootstrap version.

    Of course I refer to default Joomla template called protostar (it's free) but some premium models have already managed to create new models for Bootstrap 3.3.6.

    Good luck.

  • Tag HTML String into a normal string

    Hi all

    This is sample HTML tag string. How can I convert this to normal

    ' < s t y l e t y p e = "t e x t / c s s" > ".

    p {m m a g n e r: 0 x 0 x 0 x x ;} 2 p p p p}

    u l {m m a g r e n - t o p: 2 x p m m a g n - b o t t o m e r: 2 p x ;}}

    o l {m m a g r e n - t o p: 2 x p m m a g n - b o t t o m e r: 2 p x ;}}

    . N o r m a l {o n t - f f a m I l y: P o r t a b l e U s e r I n t e r f a c e; e o n t - s I z e: 1 1 x p; c o l o r: # 0 0 0 0 0 0; v e r t I c a l - l I g n} : m i t d d e; }

    . T a b l e D e f a u l t {b o r d e r - c o l l e s p: c o l l a s p e; b o r d e r: 1 p x s o l i d # 0 0 0 0 0 0 ;}}

    . T a b l e D e f a u l t t h {p a d d I g n: 2 p x; v e r t I c a l - l I n g: t o p; t e x t - l I g n: l e f t; b o r d e r: 1 p x s o l I d # 0 0 0 0 0 0 ;}}

    . T a b l e D e f a u l t t j {p a d d I g n: 2 p x; v e r t I c a l - l I n g: t o p; t e x t - l I g n: l e f t; r o b e u r: 1 p x s o l I d # 0 0 0 0 0 0 ;}}

    < / S T Y L E >

    < p s t y l e = "m m a g n e r: p 0 x;" > < s p n c l a s s = 'N o r m a l' > R e j e c t e d < / s p has n > < / p > '

    The string above, I pointed out the search string

    Kind regards

    Fame

    You really html with that many spaces understood?

    May be something like the below

    with atext as)

    Select '< s="" t="" y="" l="" e ="" t="" y="" p="" e=" t e x t / c s s ">

    p {m m a g n e r: 0 x 0 x 0 x x ;} 2 p p p p}

    u l {m m a g r e n - t o p: 2 x p m m a g n - b o t t o m e r: 2 p x ;}}

    o l {m m a g r e n - t o p: 2 x p m m a g n - b o t t o m e r: 2 p x ;}}

    . N o r m a l {o n t - f f a m I l y: P o r t a b l e U s e r I n t e r f a c e; e o n t - s I z e: 1 1 x p; c o l o r: # 0 0 0 0 0 0; v e r t I c a l - l I g n} : m i t d d e; }

    . T a b l e D e f a u l t {b o r d e r - c o l l e s p: c o l l a s p e; b o r d e r: 1 p x s o l i d # 0 0 0 0 0 0 ;}}

    . T a b l e D e f a u l t t h {p a d d I g n: 2 p x; v e r t I c a l - l I n g: t o p; t e x t - l I g n: l e f t; b o r d e r: 1 p x s o l I d # 0 0 0 0 0 0 ;}}

    . T a b l e D e f a u l t t j {p a d d I g n: 2 p x; v e r t I c a l - l I n g: t o p; t e x t - l I g n: l e f t; r o b e u r: 1 p x s o l I d # 0 0 0 0 0 0 ;}}

    < s="" t="" y="" l="" e="">

    < p ="" s="" t="" y="" l="" e=" m a r g i n : 0 p x ; ">< s="" p="" a="" n ="" c="" l="" a="" s="" s=" N o r m a l ">E R j e c t e d < s="" p="" a="" n=""> < p=""> ' the double t
    )

    Select
    regexp_substr (t ' >([^))<>< ,="" 1,="" level,="" null,="" 1)="">
    of atext
    connect
    level <= regexp_count(t,="" '="">([^])<><>
    and
    trim (regexp_substr (t ' >([^)))<>< ,="" 1,="" level,="" null,="" 1))="" is="" not="">

    T
    E R j e c t e d
  • Better way to format the text: tags HTML or CSS?

    Probably a silly question, but...  I can format the text in a div using CSS Styles (Font size, make-Style, Font-Weight, etc.) or by applying an HTML tag, for example, < H1 >. (Or, I guess a combination where I use CSS to format the tag, but never mind that for now.)

    In general, one approach is better than the other? Thank you!

    Titles, paragraphs, lists, etc. give the semantic meaning and the vital structure to your content.  You can build a site without CSS styles, but you can not build a site without titles, paragraphs, and other HTML tags.

    Nancy O.

  • Vertical text. Can FireFox displays a vertical text? Including the tags HTML should be used for that?

    The http://habrahabr.ru/blogs/css/58732/ site recommends a way to use vertical text in HTML/CSS (see example below). However my instance of Firefox 3.6.22 does not display this vertical text. Please let me know your recommendations.

    < title > 1 < /title >
    < style >

    < / style >

  • Sansa fuze + ignores mp3 tags

    Hi guys I just got my sansa fuze + (8 GB) and apply the 01.27.02 firmware update. Later, I download a file from my collection, but the sansa doesn't recognize all the tags of tracks. I don't know if it's a name of file or any other problem. For example, I have in my coldplay album

    drwxrwxrwx 2 tuxtor 4096 tuxtor 2010-09-27 00:41 (2002) A Rush of Blood To The Head
    drwxrwxrwx 2 tuxtor 4096 tuxtor 2010-09-27 00:49 castles
    drwxrwxrwx 2 tuxtor 4096 tuxtor 2010-01-06 01:30 Parachutes [2000]
    drwxrwxrwx 2 tuxtor 4096 tuxtor 2010-09-27 00:41 Viva La Vida or death and all his friends

    I'm sure that all the files have the good tags (I can see it in amarok, banshee, etc.), but in the sansa I can watch Parachutes and Viva vida La or dead... the other albums appear with the album unknown and artist unknown.

    tuxtor wrote:

    I'm sure that all the files have the good tags (I can see it in amarok, banshee, etc.), but in the sansa I can watch Parachutes and Viva vida La or dead... the other albums appear with the album unknown and artist unknown.

    I'd be willing to bet that they don't.

    ID3v2.3 ISO-8859-1 is the format of the desired ID3 tags. If you use Linux, I suppose that whatever program you are using is not written this tag format. There was more here before with the same scenario.

  • Insert the form inside another form tag html tag

    Hi all, this is my problem. I have a xhtml page structured as follows:

    < h:form id = "MainForm()" >

    things...

    < form id = "fileForm" action = "myServlet" method = "post" enctype = "multipart/form-data" >
    < input type = "file" onchange = "fileForm.submit ()" / > "
    < / make >
    < / h:form >

    When you download a file, I want to introduce only "fileForm. But "fileForm.submit ()" does not work because fileFom is null. Looking at the source of the page, I realized that a single form is seen (mainForm) client-side:

    < form id = "mainForm" >

    things...

    < input type = "file" onchange = "fileForm.submit ()" / > "
    < / make >

    Any idea on how to apply it?
    Thanks in advance...

    Is not possible; In my view, embedded forms are even against the HTML specification.

    Published by: cardan2 on 7 February 2012 06:51

  • Video playback on a tag html with jquery

    Hello

    I have a php/sql database a nail of the thumb and the videos to swf and flv format. On my html page, I have a swf player. I did the echo

    thumbnails and have the url of the videos. How can I get the url of the video playing on the player after a person clicks on the thumbnail with

    XML just passing the url to the reader. Kind of how youtube works thanks.

    I got some success with xml, but it cannot work in this aspect. So I looked into jquery and other alternatives.

    Hope you can help.

    Thank you.

    You are welcome.

Maybe you are looking for