producing link

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

producing link

abergel
Hi!

I am trying to produce the html content: <p>hello <a href="http://world.org">world</a></p>

I tried the following:
MyWidget>>renderOn: html
        | p |
        p := html p.
        p with: 'hello '.
        (p href: 'http://world.org') with: 'world'.

But obviously it does not work. The link does not show up.

The following does a bit better:
MyWidget>>renderOn: html
        html p: 'hello '.
        (html a href: 'http://world.org') with: 'world'.

But there the link is outside the paragraph.

By the way, is there a way to see the generated html? "View source" within Safari gives me what the index.html content is. Firefox or Chrome produces better debugging support?

Cheers,
Alexandre

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.





Reply | Threaded
Open this post in threaded view
|

Re: producing link

Nicolas Petton
Hi Alexandre!

The canvas works pretty much like in Seaside, except that it manipulate live DOM elements.

renderOn: html
html p with: [
html a
with: 'Google]

The webkit inspector allows you to see the DOM as it is. Firefox also has Firebug, or in the latest version builtin development tools.

Cheers,
Nico

On Apr 16, 2012, at 3:32 PM, Alexandre Bergel wrote:

Hi!

I am trying to produce the html content: <p>hello <a href="http://world.org">world</a></p>

I tried the following:
MyWidget>>renderOn: html
| p |
p := html p.
p with: 'hello '.
(p href: 'http://world.org') with: 'world'.

But obviously it does not work. The link does not show up.

The following does a bit better:
MyWidget>>renderOn: html
html p: 'hello '.
(html a href: 'http://world.org') with: 'world'.

But there the link is outside the paragraph.

By the way, is there a way to see the generated html? "View source" within Safari gives me what the index.html content is. Firefox or Chrome produces better debugging support?

Cheers,
Alexandre

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.






Reply | Threaded
Open this post in threaded view
|

Re: producing link

abergel
Thanks Nicolas, it works.
Yeah, I knew that my question was from a newbie :-)
If there is a FAQ where I can put this code snippet into, then I will do it.

Cheers,
Alexandre


On 16 Apr 2012, at 08:44, Nicolas Petton wrote:

> Hi Alexandre!
>
> The canvas works pretty much like in Seaside, except that it manipulate live DOM elements.
>
> renderOn: html
> html p with: [
> html a
> href: 'http://www.google.fr';
> with: 'Google]
>
> The webkit inspector allows you to see the DOM as it is. Firefox also has Firebug, or in the latest version builtin development tools.
>
> Cheers,
> Nico
> --
> Nicolas Petton
> http://www.nicolas-petton.fr
>
> On Apr 16, 2012, at 3:32 PM, Alexandre Bergel wrote:
>
>> Hi!
>>
>> I am trying to produce the html content: <p>hello <a href="http://world.org">world</a></p>
>>
>> I tried the following:
>> MyWidget>>renderOn: html
>> | p |
>> p := html p.
>> p with: 'hello '.
>> (p href: 'http://world.org') with: 'world'.
>>
>> But obviously it does not work. The link does not show up.
>>
>> The following does a bit better:
>> MyWidget>>renderOn: html
>> html p: 'hello '.
>> (html a href: 'http://world.org') with: 'world'.
>>
>> But there the link is outside the paragraph.
>>
>> By the way, is there a way to see the generated html? "View source" within Safari gives me what the index.html content is. Firefox or Chrome produces better debugging support?
>>
>> Cheers,
>> Alexandre
>>
>> --
>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>> Alexandre Bergel  http://www.bergel.eu
>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>
>>
>>
>>
>>
>

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.